Skip to content

Instantly share code, notes, and snippets.

@hrbg
Created October 1, 2011 19:45
Show Gist options
  • Save hrbg/1256555 to your computer and use it in GitHub Desktop.
Save hrbg/1256555 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'commander/import'
program :version, '0.0.1'
program :description, 'test'
command :testme do |c|
c.syntax = 'test testme [options]'
c.summary = ''
c.description = ''
c.example 'description', 'command example'
c.option '--some-switch', 'Some switch that does something'
c.option '--no-some-switch', 'Some switch that does something'
c.action do |args, options|
p options
# Do something or c.when_called Test::Commands::Testme
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment