Skip to content

Instantly share code, notes, and snippets.

@mikedamage
Created January 16, 2009 04:08
Show Gist options
  • Save mikedamage/47804 to your computer and use it in GitHub Desktop.
Save mikedamage/47804 to your computer and use it in GitHub Desktop.
require 'optparse'
app = Hash.new
options = OptionParser.new do |opts|
opts.on("-o", "--option [ARG]", "Option description") do |opt|
app['option'] = opt
end
end
begin
options.parse!(ARGV)
rescue OptionParser::ParseError => e
puts e
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment