We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dad0f87 commit b51450fCopy full SHA for b51450f
lib/optparse.rb
@@ -780,7 +780,7 @@ class PlacedArgument < self
780
# Returns nil if argument is not present or begins with '-' and is not '-'.
781
#
782
def parse(arg, argv, &error)
783
- if !(val = arg) and (argv.empty? or /\A-./ =~ (val = argv[0]))
+ if !(val = arg) and !(val = argv[0])&.match?(/\A(?!-.)/)
784
return nil, block
785
end
786
opt = (val = parse_arg(val, &error))[1]
0 commit comments