Method: Shell::Extensions::ObjectCoreExtensions#explain_command

Defined in:
lib/chef/shell/ext.rb

#explain_command(method_name) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/chef/shell/ext.rb', line 87

def explain_command(method_name)
  help = all_help_descriptions.find { |h| h.cmd.to_s == method_name.to_s }
  if help
    puts ""
    puts "Command: #{method_name}"
    puts "".ljust(80, "=")
    puts help.explanation || help.desc
    puts "".ljust(80, "=")
    puts ""
  else
    puts ""
    puts "command #{method_name} not found or no help available"
    puts ""
  end
end