require 'optiflag' # Example 4: Disallowing warnings to proceed module Example extend OptiFlag::Flagset flag "dir" flag "username" handle_errors_and_help :with_no_warnings end #h# ruby example_4.rb -garbage -dir c:/temp -username daniel -this-is-garbage that.is.left.over