diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-07 23:48:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-07 23:48:47 +0000 |
commit | 8a7fbc6fec40d77175caa412994e406305769c5a (patch) | |
tree | 96cd04e4f6c7a9d374e922ed5edc421808472789 | |
parent | 11cfb7e0f458971deca325c1d3032d1665d74bef (diff) |
* 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
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | lib/optparse.rb | 4 | ||||
-rw-r--r-- | lib/optparse/uri.rb | 2 |
3 files changed, 15 insertions, 7 deletions
@@ -1,11 +1,19 @@ +Thu Aug 8 08:29:37 2002 Nobuyoshi Nakada <[email protected]> + + * 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 <[email protected]> - * 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. diff --git a/lib/optparse.rb b/lib/optparse.rb index f93000e855..05d36e89d8 100644 --- a/lib/optparse.rb +++ b/lib/optparse.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 diff --git a/lib/optparse/uri.rb b/lib/optparse/uri.rb index b24de88b76..5bdcf57c96 100644 --- a/lib/optparse/uri.rb +++ b/lib/optparse/uri.rb @@ -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} |