diff options
author | David RodrÃguez <deivid.rodriguez@gmail.com> | 2015-01-11 16:47:37 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@gmail.com> | 2015-01-11 16:55:19 +0100 |
commit | ec610da124204aeb99380d0dba138f9e53eb99b0 (patch) | |
tree | 04960b268c4421ebbfd407a31d1d519aaeabe390 /lib/slop/parser.rb | |
parent | 1242f10f364372ddf3b86b54511e4a0265b3c629 (diff) | |
download | slop-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/slop/parser.rb')
-rw-r--r-- | lib/slop/parser.rb | 7 |
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?("=") |