diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-03-22 14:29:52 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-22 14:31:02 -0700 |
| commit | 50ba62d68ef3a6a81e00581dd7d74f6387bd73fc (patch) | |
| tree | 9017f6d830e871e66a88c91728349f2862fe7910 | |
| parent | 0af36f44643a59f5137b617afae16019b485ee05 (diff) | |
maint: Make args to Catalog.select explicit
No other args are used, so passing *args and shifting is unnecessary.
| -rw-r--r-- | README.markdown | 14 | ||||
| -rw-r--r-- | lib/puppet/interface/catalog/select.rb | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/README.markdown b/README.markdown index dd9dd5867..656a3fbad 100644 --- a/README.markdown +++ b/README.markdown @@ -96,12 +96,14 @@ Like most parts of Puppet, these are easy to extend. Just drop a new action int $ cat lib/puppet/interface/catalog/select.rb # Select and show a list of resources of a given type. - Puppet::Interface::Catalog.action :select do |*args| - host = args.shift - type = args.shift - catalog = Puppet::Resource::Catalog.indirection.find(host) - - catalog.resources.reject { |res| res.type != type }.each { |res| puts res } + Puppet::Interface.interface(:catalog) do + action :select do + invoke do |host,type| + catalog = Puppet::Resource::Catalog.indirection.find(host) + + catalog.resources.reject { |res| res.type != type }.each { |res| puts res } + end + end end $ puppet catalog select localhost Class Class[main] diff --git a/lib/puppet/interface/catalog/select.rb b/lib/puppet/interface/catalog/select.rb index 3f724d360..32d9b7c45 100644 --- a/lib/puppet/interface/catalog/select.rb +++ b/lib/puppet/interface/catalog/select.rb @@ -1,9 +1,7 @@ # Select and show a list of resources of a given type. Puppet::Interface.interface(:catalog) do action :select do - invoke do |*args| - host = args.shift - type = args.shift + invoke do |host,type| catalog = Puppet::Resource::Catalog.indirection.find(host) catalog.resources.reject { |res| res.type != type }.each { |res| puts res } |
