summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2014-12-30 15:07:58 +0000
committerLee Jarvis <ljjarvis@gmail.com>2014-12-30 15:07:58 +0000
commiteb0164aea27b43f24c05e16c3d699dac520c9945 (patch)
tree6cbef486159d587a9948891fb197a4f8d719faa6 /lib
parentd6b91418f9cb8aa141ecb1f4c00c5f06ae293b67 (diff)
downloadslop-eb0164aea27b43f24c05e16c3d699dac520c9945.tar.gz
Reset parser every time parse is called
Diffstat (limited to 'lib')
-rw-r--r--lib/slop/parser.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/slop/parser.rb b/lib/slop/parser.rb
index 50b031c..c12e2f5 100644
--- a/lib/slop/parser.rb
+++ b/lib/slop/parser.rb
@@ -34,6 +34,8 @@ module Slop
#
# Returns a Slop::Result.
def parse(strings)
+ reset # reset before every parse
+
pairs = strings.each_cons(2).to_a
# this ensures we still support the last string being a flag,
# otherwise it'll only be used as an argument.