Skip to content

Instantly share code, notes, and snippets.

Created February 18, 2009 05:59
Show Gist options
  • Save anonymous/66217 to your computer and use it in GitHub Desktop.
Save anonymous/66217 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
ARGV = ['foo'] if ARGV.empty?
require 'rubygems'
require 'commander'
program :name, 'foo'
program :version, '1.1.1'
program :description, 'Foo'
command :foo do |c|
c.syntax = ''
c.description = ''
c.example 'description', 'command example'
c.option '--some-switch', 'Some switch that does something'
c.when_called do |args, options|
puts 'foo'
end
end
command :bar do |c|
c.syntax = ''
c.description = ''
c.example 'description', 'command example'
c.option '--some-switch', 'Some switch that does something'
c.when_called do |args, options|
puts 'bar'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment