require 'optiflag' # Example 6: Using Hash Access module HashAcess extend OptiFlag::Flagset flag "dir" flag "log_level" handle_errors_and_help end puts "Dir is: #{ ARGV.flag_value[:dir] }" puts "Log Level is: #{ ARGV.flag_value[:log_level] }" #h# ruby example_6.rb -dir "c:/Program Files/Apache Software Foundation/Tomcat 5/" -log_level 3