Skip to content

Instantly share code, notes, and snippets.

/myapp.rb Secret

Created October 25, 2016 21:59
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 anonymous/33c570e19c259919fad491e8a7a2dfcc to your computer and use it in GitHub Desktop.
Save anonymous/33c570e19c259919fad491e8a7a2dfcc to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'commander/import'
program :name, 'myapp'
program :version, '0.0.1'
program :description, 'test'
command :init do |c|
c.syntax = 'myapp init [options]'
c.summary = ''
c.description = ''
c.example 'description', 'command example'
c.option '--some-switch', 'Some switch that does something'
c.action do |args, options|
puts "init called"
end
end
command :second do |c|
c.syntax = 'myapp second [options]'
c.summary = ''
c.description = ''
c.example 'description', 'command example'
c.option '--some-switch', 'Some switch that does something'
c.action do |args, options|
puts "second called"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment