diff options
Diffstat (limited to 'examples/getoptlong/argv.rb')
-rw-r--r-- | examples/getoptlong/argv.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/getoptlong/argv.rb b/examples/getoptlong/argv.rb new file mode 100644 index 0000000000..8efcad22ea --- /dev/null +++ b/examples/getoptlong/argv.rb @@ -0,0 +1,12 @@ +require 'getoptlong' + +options = GetoptLong.new( + ['--xxx', GetoptLong::REQUIRED_ARGUMENT], + ['--yyy', GetoptLong::OPTIONAL_ARGUMENT], + ['--zzz', GetoptLong::NO_ARGUMENT] +) +puts "Original ARGV: #{ARGV}" +options.each do |option, argument| + p [option, argument] +end +puts "Remaining ARGV: #{ARGV}" |