Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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