summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-09-27 09:31:28 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-09-27 09:31:28 -0700
commit289013428caa32bd1d1c4c621f92cb7961d541bb (patch)
tree1b532f4e23d031a0e6954790df8231eaad8fc80e
parent3e8b93b94e7fe971b8b054828b4631468b29eb55 (diff)
downloadchef-lcg/fix-knife-list-commands.tar.gz
fix knife list_commands()lcg/fix-knife-list-commands
this was not supposed to be private Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/knife.rb29
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index c9ecfbf0cc..0dbd02ceb4 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -236,6 +236,20 @@ class Chef
OFFICIAL_PLUGINS = %w{ec2 rackspace windows openstack terremark bluebox}
class << self
+ def list_commands(preferred_category = nil)
+ category_desc = preferred_category ? preferred_category + " " : ""
+ msg "Available #{category_desc}subcommands: (for details, knife SUB-COMMAND --help)\n\n"
+ subcommand_loader.list_commands(preferred_category).sort.each do |category, commands|
+ next if category =~ /deprecated/i
+ msg "** #{category.upcase} COMMANDS **"
+ commands.sort.each do |command|
+ subcommand_loader.load_command(command)
+ msg subcommands[command].banner if subcommands[command]
+ end
+ msg
+ end
+ end
+
private
# @api private
@@ -270,21 +284,6 @@ class Chef
end
# @api private
- def list_commands(preferred_category = nil)
- category_desc = preferred_category ? preferred_category + " " : ""
- msg "Available #{category_desc}subcommands: (for details, knife SUB-COMMAND --help)\n\n"
- subcommand_loader.list_commands(preferred_category).sort.each do |category, commands|
- next if category =~ /deprecated/i
- msg "** #{category.upcase} COMMANDS **"
- commands.sort.each do |command|
- subcommand_loader.load_command(command)
- msg subcommands[command].banner if subcommands[command]
- end
- msg
- end
- end
-
- # @api private
def reset_config_path!
@@chef_config_dir = nil
end