Skip to content

Instantly share code, notes, and snippets.

@mdub
Created April 24, 2012 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdub/2476284 to your computer and use it in GitHub Desktop.
Save mdub/2476284 to your computer and use it in GitHub Desktop.
Play with getoptlong
require 'getoptlong'
opts = GetoptLong.new(
[ "--name", "-n", GetoptLong::REQUIRED_ARGUMENT ],
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--version", "-v", GetoptLong::NO_ARGUMENT ]
)
opts.each do |opt, arg|
p [opt, arg]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment