require 'optiflag' # Example 2.2: # Variation 2: Adding descriptions to the flags (will appear in extended help) ### NOTE how 'description' can be nested in a block or used as a symbol key module Example extend OptiFlag::Flagset flag "dir" do description "The Appliction Directory" end optional_flag "log" do description "The directory in which to find the log files" end flag "username", :description => "Database username." # alternate form flag "password" do description "Database password." end usage_flag "h","help","?" extended_help_flag "superhelp" handle_errors_and_help end ## Works (triggers extended help): # ruby example_2_2.rb -superhelp --dir directory --username me --password fluffy # ruby example_2_2.rb -superhelp --dir directory --username me --password fluffy # ruby example_2_2.rb -superhelp --dir directory --username me --password fluffy # ruby example_2_2.rb -superhelp --dir directory --username me # ruby example_2_2.rb -superhelp --dir directory # ruby example_2_2.rb -superhelp #h# ruby example_2_2.rb --superhelp