summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application/string_base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/application/string_base.rb')
-rw-r--r--lib/puppet/application/string_base.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/puppet/application/string_base.rb b/lib/puppet/application/string_base.rb
index a082ba0e2..8284a3185 100644
--- a/lib/puppet/application/string_base.rb
+++ b/lib/puppet/application/string_base.rb
@@ -84,7 +84,6 @@ class Puppet::Application::StringBase < Puppet::Application
raise ArgumentError, "#{@string} does not have an #{item.inspect} action!"
end
@action = action
- command_line.args.delete_at(index)
end
end
@@ -105,7 +104,12 @@ class Puppet::Application::StringBase < Puppet::Application
# action to read in the options. This replaces the older model where we
# would invoke the action with options set as global state in the
# interface object. --daniel 2011-03-28
- @arguments = command_line.args
+ #
+ # Note: because of our definition of where the action is set, we end up
+ # with it *always* being the first word of the remaining set of command
+ # line arguments. So, strip that off when we construct the arguments to
+ # pass down to the string action. --daniel 2011-04-04
+ @arguments = command_line.args[1, -1] || []
@arguments << options
end