summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-24 04:09:31 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-24 04:09:31 +0000
commite4e1f0e2cfc9ee23540c48a62895992f70f15c63 (patch)
tree3c508c9825b7642b7852e83ca4917ccda7d922e4 /lib
parent611c9929a5793ec98677065002352458e1a7ecaa (diff)
merges r20895 and r20902 from trunk into ruby_1_9_1.
* lib/optparse.rb (SPLAT_PROC): fix for regexp. [ruby-dev:37514] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 0548a29ca..e52d5d275 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -996,7 +996,7 @@ class OptionParser
end
private :notwice
- SPLAT_PROC = proc {|*a| a}
+ SPLAT_PROC = proc {|*a| a.length <= 1 ? a.first : a}
#
# Creates an OptionParser::Switch from the parameters. The parsed argument
# value is passed to the given block, where it can be processed.