Class: Rouge::CLI::Help
- Inherits:
-
Rouge::CLI
- Object
- Rouge::CLI
- Rouge::CLI::Help
- Defined in:
- lib/rouge/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Help
constructor
A new instance of Help.
- #run ⇒ Object
Methods inherited from Rouge::CLI
Constructor Details
#initialize(opts = {}) ⇒ Help
Returns a new instance of Help.
120 121 122 |
# File 'lib/rouge/cli.rb', line 120 def initialize(opts={}) @mode = opts[:mode] end |
Class Method Details
.desc ⇒ Object
95 96 97 |
# File 'lib/rouge/cli.rb', line 95 def self.desc "print help info" end |
.doc {|%|usage: rougify help <command>|| ... } ⇒ Object
99 100 101 102 103 104 105 |
# File 'lib/rouge/cli.rb', line 99 def self.doc return enum_for(:doc) unless block_given? yield %|usage: rougify help <command>| yield %|| yield %|print help info for <command>.| end |
.parse(argv) ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/rouge/cli.rb', line 107 def self.parse(argv) opts = { :mode => CLI } until argv.empty? arg = argv.shift klass = class_from_arg(arg) if klass opts[:mode] = klass next end end new(opts) end |
Instance Method Details
#run ⇒ Object
124 125 126 |
# File 'lib/rouge/cli.rb', line 124 def run @mode.doc.each(&method(:puts)) end |