summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/knife/download.rb9
-rw-r--r--lib/chef/knife/upload.rb9
2 files changed, 12 insertions, 6 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
diff --git a/lib/chef/knife/upload.rb b/lib/chef/knife/upload.rb
index ff8616543e..bb1e365798 100644
--- a/lib/chef/knife/upload.rb
+++ b/lib/chef/knife/upload.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 upload everything in this directory, type \"knife upload .\"")
+ exit 1
+ end
- # Get the matches (recursively)
- patterns.each do |pattern|
+ pattern_args.each do |pattern|
Chef::ChefFS::FileSystem.copy_to(pattern, local_fs, chef_fs, config[:recurse] ? nil : 1, config)
end
end