diff options
author | sawanoboly <sawanoboriyu@higanworks.com> | 2014-08-12 15:55:33 +0900 |
---|---|---|
committer | sawanoboly <sawanoboriyu@higanworks.com> | 2014-08-12 15:55:33 +0900 |
commit | bea385b45620c5c5769d8680758181770b3c148f (patch) | |
tree | 7ab0b0b9ab2b67484f20bde69dad6d3db1a801bf /lib/chef/knife | |
parent | 803a57c70b97bc703fb80c4fe4287639766c022c (diff) | |
download | chef-bea385b45620c5c5769d8680758181770b3c148f.tar.gz |
change option name --preview-archive to --[no-]upload
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/cookbook_site_share.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index b9db4d7db5..0a8461937d 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -40,10 +40,11 @@ class Chef :description => "A colon-separated path to look for cookbooks in", :proc => lambda { |o| Chef::Config.cookbook_path = o.split(":") } - option :preview_archive, - :long => "--preview-archive", - :description => "Only preview archived files. (Don't upload.)", - :boolean => true + option :upload, + :long => "--[no-]upload", + :description => "Upload cookbook to SuperMacket, defaults is true. If given --no-upload, only show list of archived files", + :boolean => true, + :default => true def run if @name_args.length < 2 @@ -71,8 +72,8 @@ class Chef exit(1) end - if config[:preview_archive] - ui.info("Notice: These files will upload to supermarket. Be careful.") + unless config[:upload] + ui.info("Not uploading #{cookbook_name}.tgz due to --no-upload flag.") result = shell_out!("tar -tzf #{cookbook_name}.tgz", :cwd => tmp_cookbook_dir) ui.info(result.stdout) FileUtils.rm_rf tmp_cookbook_dir |