Skip to content

Instantly share code, notes, and snippets.

@jhulten
Forked from anonymous/gist:66217
Created February 18, 2009 22:13
Show Gist options
  • Save jhulten/66581 to your computer and use it in GitHub Desktop.
Save jhulten/66581 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