summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLee Jarvis <leejarvis@fastmail.com>2021-05-27 19:08:38 +0100
committerLee Jarvis <leejarvis@fastmail.com>2021-05-28 19:13:01 +0100
commit89ca46436db6e501790bf7c71cd9dd70569463b8 (patch)
treebf0eea5704c2eacad0f138f76a7f1077a953533a /lib
parent09e7db5ba53c94d32c57a100ec6bbf64b64d3afe (diff)
downloadslop-89ca46436db6e501790bf7c71cd9dd70569463b8.tar.gz
Add support for --opt="" for blank arguments
This is especially useful when your default option value is a non-blank value and you want users to be able to overwrite it with a blank value Closes #266
Diffstat (limited to 'lib')
-rw-r--r--lib/slop/parser.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/slop/parser.rb b/lib/slop/parser.rb
index 00b7e33..49d0230 100644
--- a/lib/slop/parser.rb
+++ b/lib/slop/parser.rb
@@ -52,7 +52,7 @@ module Slop
# support `foo=bar`
orig_flag = flag.dup
- if match = flag.match(/([^=]+)=([^=]+)/)
+ if match = flag.match(/([^=]+)=([^=]*)/)
flag, arg = match.captures
end