summaryrefslogtreecommitdiff
path: root/lib/chef/knife/download.rb
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2012-11-21 11:39:45 -0800
committerBryan McLellan <btm@opscode.com>2012-12-03 10:00:56 -0800
commit7fbf9c89325312ab91c73a65cdc3a1869760012e (patch)
treed58770cb1bd5d8083e672e4b92be1fffd8bc68c6 /lib/chef/knife/download.rb
parent713e23b85ef27ebb775dfa1386f040b197cbc18e (diff)
downloadchef-7fbf9c89325312ab91c73a65cdc3a1869760012e.tar.gz
Complain if no arguments are specified to upload or download
Diffstat (limited to 'lib/chef/knife/download.rb')
-rw-r--r--lib/chef/knife/download.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/knife/download.rb b/lib/chef/knife/download.rb
index f891e55530..dc2588b6b5 100644
--- a/lib/chef/knife/download.rb
+++ b/lib/chef/knife/download.rb
@@ -34,10 +34,13 @@ class Chef
:description => "Don't take action, only print what would happen"
def run
- patterns = pattern_args_from(name_args.length > 0 ? name_args : [ "" ])
+ if name_args.length == 0
+ show_usage
+ ui.fatal("Must specify at least one argument. If you want to download everything in this directory, type \"knife download .\"")
+ exit 1
+ end
- # Get the matches (recursively)
- patterns.each do |pattern|
+ pattern_args.each do |pattern|
Chef::ChefFS::FileSystem.copy_to(pattern, chef_fs, local_fs, config[:recurse] ? nil : 1, config)
end
end