Revision: 6399
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 20, 2008 03:35 by mikegreen
Initial Code
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
Initial URL
Initial Description
Simple command line option parser snippet
Initial Title
Ruby Command Line Option Parser
Initial Tags
ruby
Initial Language
Ruby