зеркало из https://github.com/github/ruby.git
* 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:
Родитель
11cfb7e0f4
Коммит
8a7fbc6fec
16
ChangeLog
16
ChangeLog
|
@ -1,11 +1,19 @@
|
|||
Thu Aug 8 08:29:37 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* lib/optparse.rb (OptionParser::Switch::parse_arg): require block
|
||||
always.
|
||||
|
||||
* lib/optparse.rb (NilClass): must provide conversion block.
|
||||
|
||||
Wed Aug 7 22:12:54 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* optparse.rb (OptionParser::Completion::convert): returned all
|
||||
values not first one.
|
||||
* lib/optparse.rb (OptionParser::Completion::convert): returned
|
||||
all values not first one.
|
||||
|
||||
* optparse.rb (OptionParser::Switch::parse): return values as is.
|
||||
* lib/optparse.rb (OptionParser::Switch::parse): return values as
|
||||
is.
|
||||
|
||||
* optparse.rb (OptionParser::order): ditto.
|
||||
* lib/optparse.rb (OptionParser::order): ditto.
|
||||
|
||||
* lib/optparse/time.rb: prior time.rb.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
require 'optparse'
|
||||
require 'uri'
|
||||
|
||||
OptionParser.accept(URI) {|s| [URI.parse(s)] if s}
|
||||
OptionParser.accept(URI) {|s| URI.parse(s) if s}
|
||||
|
|
Загрузка…
Ссылка в новой задаче