summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLee Jarvis <leejarvis@fastmail.com>2018-03-12 13:54:56 +0000
committerLee Jarvis <leejarvis@fastmail.com>2018-03-12 13:56:18 +0000
commitd787c9a60b89e219d0f3791d48b2752b4d92af1d (patch)
tree8ae6103238d4c5c7cf583ae423c9bb0e2c6397b7 /lib
parent1241a0ce6b3aca2eb4b31488976b85de9fd8e306 (diff)
downloadslop-d787c9a60b89e219d0f3791d48b2752b4d92af1d.tar.gz
Handle equals character for non-option valuespedantic-equals
If the string includes an equals char but doesn't look like it's a possible candidate for a flag=value, we should ignore it see #226
Diffstat (limited to 'lib')
-rw-r--r--lib/slop/parser.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/slop/parser.rb b/lib/slop/parser.rb
index 463e75a..27e1c50 100644
--- a/lib/slop/parser.rb
+++ b/lib/slop/parser.rb
@@ -53,8 +53,8 @@ module Slop
# support `foo=bar`
orig_flag = flag.dup
orig_arg = arg
- if flag.include?("=")
- flag, arg = flag.split("=")
+ if match = flag.match(/([^=]+)=([^=]+)/)
+ flag, arg = match.captures
end
if opt = try_process(flag, arg)