Sha256: 5b574976efb4a1a5fadee85766572b159a39f9414e4ea376c2e2a26db0159f8d

Contents?: true

Size: 345 Bytes

Versions: 2

Compression:

Stored size: 345 Bytes

Contents

require 'getoptlong'

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
getoptlong-0.2.1 sample/getoptlong/return_in_order.rb
getoptlong-0.2.0 sample/getoptlong/return_in_order.rb