diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2014-12-30 15:07:58 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2014-12-30 15:07:58 +0000 |
commit | eb0164aea27b43f24c05e16c3d699dac520c9945 (patch) | |
tree | 6cbef486159d587a9948891fb197a4f8d719faa6 /lib | |
parent | d6b91418f9cb8aa141ecb1f4c00c5f06ae293b67 (diff) | |
download | slop-eb0164aea27b43f24c05e16c3d699dac520c9945.tar.gz |
Reset parser every time parse is called
Diffstat (limited to 'lib')
-rw-r--r-- | lib/slop/parser.rb | 2 |
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. |