require 'optiflag' # Example 5: Using keyword module Example extend OptiFlag::Flagset keyword "checkin" do alternate_forms "ci" end keyword "checkout" do alternate_forms "co" end flag "file" flag "m" do alternate_forms "message" end handle_errors_and_help end puts "User has chosen to checkin #{ARGV.flag_value.file } " if ARGV.flag_value.ci? puts "User has chosen to check out #{ARGV.flag_value.file }" if ARGV.flag_value.checkout? #h# ruby example_5.rb ci -file c:/StronglyTyped.java -m done #h# ruby example_5.rb co -file c:/StronglyTyped.java -m done