mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[ruby/optparse] Allow non-string enum list #79
Command line arguments are strings, convert enum list elements to
strings to match.
c5ec052efc
This commit is contained in:
parent
213c27825a
commit
cdf36d6bfd
2 changed files with 7 additions and 1 deletions
|
@ -1503,7 +1503,7 @@ XXX
|
|||
else
|
||||
raise ArgumentError, "argument pattern given twice"
|
||||
end
|
||||
o.each {|pat, *v| pattern[pat] = v.fetch(0) {pat}}
|
||||
o.each {|pat, *v| pattern[pat.to_s] = v.fetch(0) {pat}}
|
||||
when Module
|
||||
raise ArgumentError, "unsupported argument type: #{o}", ParseError.filter_backtrace(caller(4))
|
||||
when *ArgumentStyle.keys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue