PHP 8.2.31
Preview: each.rb Size: 315 B
//proc/thread-self/root/opt/alt/ruby40/share/gems/gems/getoptlong-0.2.1/sample/getoptlong/each.rb

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}"

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
187 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
176 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
298 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
315 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
1.15 KB lrw-r--r-- 2026-05-21 12:15:23
Edit Download
298 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
343 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
345 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
201 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download
237 B lrw-r--r-- 2026-05-21 12:15:23
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).