Class: Awshucks::HelpCommand

Inherits:
Command show all
Defined in:
lib/awshucks/commands/help.rb

Instance Method Summary collapse

Methods inherited from Command

commands, execute, inherited, #option_parser, option_string, parse_and_execute

Instance Method Details

#execute(args, config) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/awshucks/commands/help.rb', line 8

def execute(args, config)
  if args.empty?
    puts config.help_message
  else
    if cmd = Command.commands[args.first]
      puts cmd.option_string
    else
      $stderr.puts "Could not find command #{args.first}"
    end
  end
end