From dbb966bb956f533f8259a5078cda02a45bd5c867 Mon Sep 17 00:00:00 2001 From: Daniel DeLeo Date: Thu, 14 Apr 2011 16:04:16 -0700 Subject: [CHEF-2223] detect missing plugins --- chef/lib/chef/knife.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'chef') diff --git a/chef/lib/chef/knife.rb b/chef/lib/chef/knife.rb index 78831a4150..70d2aa3226 100644 --- a/chef/lib/chef/knife.rb +++ b/chef/lib/chef/knife.rb @@ -204,6 +204,8 @@ class Chef private + OFFICIAL_PLUGINS = %w[ec2 rackspace windows openstack terremark bluebox] + # :nodoc: # Error out and print usage. probably becuase the arguments given by the # user could not be resolved to a subcommand. @@ -211,7 +213,16 @@ class Chef unless want_help?(args) ui.fatal("Cannot find sub command for: '#{args.join(' ')}'") end - list_commands(guess_category(args)) + + if category_commands = guess_category(args) + list_commands(category_commands) + elsif missing_plugin = ( OFFICIAL_PLUGINS.find {|plugin| plugin == args[0]} ) + ui.info("The #{missing_plugin} commands were moved to plugins in Chef 0.10") + ui.info("You can install the plugin with `(sudo) gem install knife-#{missing_plugin}") + else + list_commands + end + exit 10 end -- cgit v1.2.1