Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'rubygems'
- require 'commander/import'
- class MyApplication
- include Commander::Methods
- @never_trace = true
- def run
- program :name, 'Foo Bar'
- program :version, '1.0.0'
- program :description, 'Generate 1+1 pairings'
- command :create do |c|
- c.syntax = 'ifttt create <name> [options]'
- c.summary = 'Create new object'
- c.example 'description', "ifttt create -g frontend\n OR\n ifttt create -u ringo@starr.org"
- c.option '-t', 'Create team'
- c.option '-m', 'Create user'
- c.action do |args, options|
- p options
- args.each {|arg| p arg }
- end
- end
- command :destroy do |c|
- c.syntax = 'ifttt destroy <name> [options]'
- c.summary = 'Create new object'
- c.example 'description', "ifttt destroy frontend\n OR\n ifttt destroy ringo@starr.org"
- c.action do |args, options|
- p args
- end
- end
- run!
- end
- end
- MyApplication.new.run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement