1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/sample/getoptlong/each.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
315 B
Ruby
Raw Normal View History

require 'getoptlong'
options = GetoptLong.new(
['--xxx', '-x', GetoptLong::REQUIRED_ARGUMENT],
['--yyy', '-y', GetoptLong::OPTIONAL_ARGUMENT],
['--zzz', '-z',GetoptLong::NO_ARGUMENT]
)
puts "Original ARGV: #{ARGV}"
options.each do |option, argument|
p [option, argument]
end
puts "Remaining ARGV: #{ARGV}"