Class: Envo::Cli::Help
- Inherits:
-
Object
- Object
- Envo::Cli::Help
- Defined in:
- lib/envo/cli/help.rb
Instance Method Summary collapse
- #add_cmd(usage, text) ⇒ Object
-
#initialize ⇒ Help
constructor
A new instance of Help.
- #print(stream) ⇒ Object
Constructor Details
#initialize ⇒ Help
Returns a new instance of Help.
4 5 6 |
# File 'lib/envo/cli/help.rb', line 4 def initialize @commands = [] end |
Instance Method Details
#add_cmd(usage, text) ⇒ Object
7 8 9 |
# File 'lib/envo/cli/help.rb', line 7 def add_cmd(usage, text) @commands << [usage, text] end |
#print(stream) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/envo/cli/help.rb', line 10 def print(stream) @commands.each do |cmd| stream.puts " * #{cmd[0]}" cmd[1].each_line do |line| stream.puts " #{line}" end end end |