diff options
author | Daniel DeLeo <dan@opscode.com> | 2011-04-14 16:04:16 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2011-04-14 16:04:16 -0700 |
commit | dbb966bb956f533f8259a5078cda02a45bd5c867 (patch) | |
tree | 641cea09bcd01483a8a27732fc785de18275c9dc /chef | |
parent | aaf38501ef93abecd9761428accf4898299c5937 (diff) | |
download | chef-dbb966bb956f533f8259a5078cda02a45bd5c867.tar.gz |
[CHEF-2223] detect missing plugins
Diffstat (limited to 'chef')
-rw-r--r-- | chef/lib/chef/knife.rb | 13 |
1 files changed, 12 insertions, 1 deletions
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 |