mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			298 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			298 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
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}"
 |