Created
April 24, 2012 04:00
-
-
Save mdub/2476284 to your computer and use it in GitHub Desktop.
Play with getoptlong
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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