mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/optparse.rb (OptionParser::Switch::parse_arg): require block
always. * lib/optparse.rb (NilClass): must provide conversion block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
11cfb7e0f4
commit
8a7fbc6fec
3 changed files with 15 additions and 7 deletions
|
@ -210,7 +210,7 @@ Individual switch class.
|
|||
=end #'#"#`#
|
||||
def parse(arg, *val)
|
||||
if block
|
||||
val = conv.yield(*val) if conv
|
||||
val = conv.yield(*val)
|
||||
return arg, block, val
|
||||
else
|
||||
return arg, nil
|
||||
|
@ -1285,7 +1285,7 @@ Default options, which never appear in option summary.
|
|||
=end #'#"#`#
|
||||
accept(Object) {|s|s or s.nil?}
|
||||
|
||||
accept(NilClass)
|
||||
accept(NilClass) {|s|s}
|
||||
|
||||
=begin
|
||||
: String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue