Class: Hookers::Commands::Help
- Inherits:
-
Object
- Object
- Hookers::Commands::Help
- Includes:
- Hookers::Command
- Defined in:
- lib/hookers/commands/help.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
-
#initialize(command, args) ⇒ Help
constructor
A new instance of Help.
- #run ⇒ Object
Methods included from Hookers::Command
Constructor Details
#initialize(command, args) ⇒ Help
Returns a new instance of Help.
10 11 12 |
# File 'lib/hookers/commands/help.rb', line 10 def initialize(command, args) self.args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
8 9 10 |
# File 'lib/hookers/commands/help.rb', line 8 def args @args end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hookers/commands/help.rb', line 14 def run if args.length == 0 || Hookers.commands[args[0]] == nil puts "Use hookers help <command> for additional options\nAvailable commands: " Hookers.commands.keys.each { |k| puts "\t#{k}" } return end if Hookers.commands[args[0]] && Hookers.commands[args[0]].respond_to?(:slop) puts Hookers.commands[args[0]].slop.help end end |