summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Delano <stephen@opscode-stephen.local>2010-03-26 13:51:44 -0700
committerStephen Delano <stephen@opscode-stephen.local>2010-03-26 13:51:44 -0700
commit7def4b217351212782f9214dac9dd2f1a8de78af (patch)
tree53644c48791fb17b4a72afc6f3bce3c7a482c9cd
parent5e317d8b0aeca0c8718c4c80c7afeb27d7f339f8 (diff)
downloadmixlib-cli-7def4b217351212782f9214dac9dd2f1a8de78af.tar.gz
moving argv.dup to top of parse_options to preserve return behavior
-rw-r--r--lib/mixlib/cli.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mixlib/cli.rb b/lib/mixlib/cli.rb
index e5daf14..31eb3d9 100644
--- a/lib/mixlib/cli.rb
+++ b/lib/mixlib/cli.rb
@@ -118,6 +118,7 @@ module Mixlib
# === Returns
# argv<Array>:: Returns any un-parsed elements.
def parse_options(argv=ARGV)
+ argv = argv.dup
@opt_parser = OptionParser.new do |opts|
# Set the banner
opts.banner = banner
@@ -158,7 +159,7 @@ module Mixlib
opts.send(*full_opt)
end
end
- @opt_parser.parse!(argv.dup)
+ @opt_parser.parse!(argv)
# Deal with any required values
options.each do |opt_key, opt_value|