From 289013428caa32bd1d1c4c621f92cb7961d541bb Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 27 Sep 2016 09:31:28 -0700 Subject: fix knife list_commands() this was not supposed to be private Signed-off-by: Lamont Granquist --- lib/chef/knife.rb | 29 ++++++++++++++--------------- 1 file 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 @@ -269,21 +283,6 @@ class Chef exit 10 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 -- cgit v1.2.1