require 'optiflag' # Example 2.1: # Variation 1: Using an extended usage flag module Example extend OptiFlag::Flagset flag "dir" optional_flag "log" flag "username" flag "password" usage_flag "h","help","?" extended_help_flag "superhelp" handle_errors_and_help end #h# ruby example_2_1.rb -superhelp --dir directory --username me --password fluffy # ruby example_2_1.rb -superhelp --dir directory --username me --password fluffy # ruby example_2_1.rb -superhelp --dir directory --username me --password fluffy # ruby example_2_1.rb -superhelp --dir directory --username me # ruby example_2_1.rb -superhelp --dir directory # ruby example_2_1.rb -superhelp #h# ruby example_2_1.rb --superhelp