summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@gmail.com>2015-01-11 16:47:37 +0100
committerDavid Rodríguez <deivid.rodriguez@gmail.com>2015-01-11 16:55:19 +0100
commitec610da124204aeb99380d0dba138f9e53eb99b0 (patch)
tree04960b268c4421ebbfd407a31d1d519aaeabe390 /lib
parent1242f10f364372ddf3b86b54511e4a0265b3c629 (diff)
downloadslop-ec610da124204aeb99380d0dba138f9e53eb99b0.tar.gz
Remove "--" from the unprocessed arguments
The double dash is a valid (special) option for Slop, so like the rest of the options successfully processed, should be removed.
Diffstat (limited to 'lib')
-rw-r--r--lib/slop/parser.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/slop/parser.rb b/lib/slop/parser.rb
index c12e2f5..246da9f 100644
--- a/lib/slop/parser.rb
+++ b/lib/slop/parser.rb
@@ -44,8 +44,13 @@ module Slop
@arguments = strings.dup
pairs.each do |flag, arg|
+ break if !flag
+
# ignore everything after '--', flag or not
- break if !flag || flag == '--'
+ if flag == '--'
+ arguments.delete(flag)
+ break
+ end
# support `foo=bar`
if flag.include?("=")