Skip to content

Backport from v0.5.0 to fix a bug #74 #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Backport from v0.5.0 to fix a bug #74
  • Loading branch information
kwatch committed Oct 3, 2024
commit 08d639ba6204a8e6633fb962822e70a90f440aae
13 changes: 9 additions & 4 deletions lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1641,14 +1641,19 @@ def parse_in_order(argv = default_argv, setter = nil, &nonopt) # :nodoc:
opt, rest = $1, $2
opt.tr!('_', '-')
begin
sw, = complete(:long, opt, true)
if require_exact && !sw.long.include?(arg)
throw :terminate, arg unless raise_unknown
raise InvalidOption, arg
if require_exact
sw, = search(:long, opt)
else
sw, = complete(:long, opt, true)
end
rescue ParseError
throw :terminate, arg unless raise_unknown
raise $!.set_option(arg, true)
else
unless sw
throw :terminate, arg unless raise_unknown
raise InvalidOption, arg
end
end
begin
opt, cb, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy