Class: TreeRepl::Help

Inherits:
Cmd
  • Object
show all
Defined in:
lib/treerepl/cmds.rb

Instance Attribute Summary

Attributes inherited from Cmd

#name, #repl

Instance Method Summary collapse

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

#helpObject



84
85
86
# File 'lib/treerepl/cmds.rb', line 84

def help
  'Print this message'
end