Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'rubygems'
  4. require 'commander/import'
  5.  
  6. class MyApplication
  7. include Commander::Methods
  8.  
  9. @never_trace = true
  10.  
  11. def run
  12. program :name, 'Foo Bar'
  13. program :version, '1.0.0'
  14. program :description, 'Generate 1+1 pairings'
  15.  
  16. command :create do |c|
  17. c.syntax = 'ifttt create <name> [options]'
  18. c.summary = 'Create new object'
  19. c.example 'description', "ifttt create -g frontend\n OR\n ifttt create -u ringo@starr.org"
  20. c.option '-t', 'Create team'
  21. c.option '-m', 'Create user'
  22. c.action do |args, options|
  23. p options
  24. args.each {|arg| p arg }
  25. end
  26. end
  27.  
  28. command :destroy do |c|
  29. c.syntax = 'ifttt destroy <name> [options]'
  30. c.summary = 'Create new object'
  31. c.example 'description', "ifttt destroy frontend\n OR\n ifttt destroy ringo@starr.org"
  32. c.action do |args, options|
  33. p args
  34. end
  35. end
  36.  
  37. run!
  38. end
  39. end
  40.  
  41. MyApplication.new.run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement