require 'optiflag' # Example 2.5: # Variation 5: User can get help on a specific flag. module Example extend OptiFlag::Flagset flag "dir" optional_flag "log" do description "The directory into which log files will be written" end flag "username" do description "A Zeta-Blub Appliction Username." end flag "password" do description "Your IT issued password. Don't forget it!" end usage_flag "h","help","?" handle_errors_and_help end ## Normal mode: # ruby example_2_5.rb -help # ruby example_2_5.rb -? # ruby example_2_5.rb -h ## Help on something specific: #h# ruby example_2_5.rb -help username #h# ruby example_2_5.rb -? log #h# ruby example_2_5.rb -h password