summaryrefslogtreecommitdiff
path: root/lib/chef/knife/show.rb
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2012-12-18 08:05:12 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:13 -0700
commit20c26a8feb6b17a585a0f766e99474c6b0d822d5 (patch)
tree4669006dda97a259c12b765bb3651f530b28365d /lib/chef/knife/show.rb
parent360de4b0a382012d05ee129a8f5d5b23aa7da06b (diff)
downloadchef-20c26a8feb6b17a585a0f766e99474c6b0d822d5.tar.gz
Add knife show --local
Diffstat (limited to 'lib/chef/knife/show.rb')
-rw-r--r--lib/chef/knife/show.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/knife/show.rb b/lib/chef/knife/show.rb
index 7075315b08..16d4eb2dab 100644
--- a/lib/chef/knife/show.rb
+++ b/lib/chef/knife/show.rb
@@ -8,10 +8,15 @@ class Chef
common_options
+ option :local,
+ :long => '--local',
+ :boolean => true,
+ :description => "Show local files instead of remote"
+
def run
# Get the matches (recursively)
pattern_args.each do |pattern|
- Chef::ChefFS::FileSystem.list(chef_fs, pattern) do |result|
+ Chef::ChefFS::FileSystem.list(config[:local] ? local_fs : chef_fs, pattern) do |result|
if result.dir?
STDERR.puts "#{result.path_for_printing}: is a directory" if pattern.exact_path
else