summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-02-23 00:20:15 -0800
committerLuke Kanies <luke@puppetlabs.com>2011-02-23 00:20:15 -0800
commit59a648502a8f09948bd2d25a72a9099f7740e108 (patch)
tree3de97951a28a4710df603b86b69dec67211280bb /lib/puppet/interface
parent4fa54d02a2806e8fde54da9bb7e4d6735b3cffe4 (diff)
downloadpuppet-59a648502a8f09948bd2d25a72a9099f7740e108.tar.gz
puppet-59a648502a8f09948bd2d25a72a9099f7740e108.tar.xz
puppet-59a648502a8f09948bd2d25a72a9099f7740e108.zip
Adding Application options to Interfaces
This allows all of the actions to react to the CLI options. I've also removed the unnecessary 'name' variables I was using in various places - they were just the first of the arguments, and they weren't actually always names. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface')
-rw-r--r--lib/puppet/interface/indirector.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/puppet/interface/indirector.rb b/lib/puppet/interface/indirector.rb
index feb356d85..f106db4b8 100644
--- a/lib/puppet/interface/indirector.rb
+++ b/lib/puppet/interface/indirector.rb
@@ -10,20 +10,20 @@ class Puppet::Interface::Indirector < Puppet::Interface
Puppet::Indirector::Terminus.terminus_classes(indirection.to_sym).collect { |t| t.to_s }.sort
end
- action :destroy do |name, *args|
- call_indirection_method(:destroy, name, *args)
+ action :destroy do |*args|
+ call_indirection_method(:destroy, *args)
end
- action :find do |name, *args|
- call_indirection_method(:find, name, *args)
+ action :find do |*args|
+ call_indirection_method(:find, *args)
end
- action :save do |name, *args|
- call_indirection_method(:save, name, *args)
+ action :save do |*args|
+ call_indirection_method(:save, *args)
end
- action :search do |name, *args|
- call_indirection_method(:search, name, *args)
+ action :search do |*args|
+ call_indirection_method(:search, *args)
end
attr_accessor :from
@@ -55,9 +55,9 @@ class Puppet::Interface::Indirector < Puppet::Interface
end
end
- def call_indirection_method(method, name, *args)
+ def call_indirection_method(method, *args)
begin
- result = indirection.send(method, name, *args)
+ result = indirection.send(method, *args)
rescue => detail
puts detail.backtrace if Puppet[:trace]
raise "Could not call '#{method}' on '#{indirection_name}': #{detail}"