Skip to content

Instantly share code, notes, and snippets.

@animist
Created October 27, 2010 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save animist/648756 to your computer and use it in GitHub Desktop.
Save animist/648756 to your computer and use it in GitHub Desktop.
Ruby cli skelton
#!/usr/bin/env ruby
require 'optparse'
# --- Default parameters ---
a = "example"
summary = <<EOT
Program Description
Usage: #{File::basename($0)} [options]
EOT
opts = OptionParser.new(summary)
opts.on("-x", "--x=VAL") do |v|
end
begin
opts.parse!
rescue
print opts.help
exit
end
# --- Write main program from here ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment