Skip to content

Instantly share code, notes, and snippets.

@psykidellic
Created October 9, 2013 00:44
Show Gist options
  • Select an option

  • Save psykidellic/6894327 to your computer and use it in GitHub Desktop.

Select an option

Save psykidellic/6894327 to your computer and use it in GitHub Desktop.
[myhost tmp]$ ruby check_opt.rb --temp
--temp
[myhost tmp]$ more check_opt.rb
require 'getoptlong'
opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--repeat', '-n', GetoptLong::REQUIRED_ARGUMENT ],
[ '--name', GetoptLong::OPTIONAL_ARGUMENT ]
)
puts ARGV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment