Class: TreeRepl::Help
Instance Attribute Summary
Attributes inherited from Cmd
Instance Method Summary collapse
- #exec(args) ⇒ Object
- #help ⇒ Object
-
#initialize(repl) ⇒ Help
constructor
A new instance of Help.
Constructor Details
#initialize(repl) ⇒ Help
Returns a new instance of Help.
81 82 83 |
# File 'lib/treerepl/cmds.rb', line 81 def initialize(repl) super(repl,'help') end |
Instance Method Details
#exec(args) ⇒ Object
87 88 89 90 91 92 |
# File 'lib/treerepl/cmds.rb', line 87 def exec(args) puts 'Commands:' repl.commands.sort {|a,b| a.name <=> b.name}.each do |cmd| printf " %-10s %s\n",cmd.name,cmd.help end end |
#help ⇒ Object
84 85 86 |
# File 'lib/treerepl/cmds.rb', line 84 def help 'Print this message' end |