summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-30 01:42:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-30 01:42:03 +0000
commitb3b121496fa3ef61ad69b269e584b5b37bbddf6d (patch)
tree35d1cc9f302a9d37983b8386b9c68b2a18662b17 /lib
parent24aba0805467feda3ea23b8ea39f7b07188727f1 (diff)
* lib/rake.rb (Rake::Application#help): fix for OPTIONAL_ARGUMENT and
multiple short options. [ruby-dev:36051] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rwxr-xr-xlib/rake.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/rake.rb b/lib/rake.rb
index 068a0ceb21..0b21eb7350 100755
--- a/lib/rake.rb
+++ b/lib/rake.rb
@@ -1984,13 +1984,18 @@ module Rake
puts
puts "Options are ..."
puts
- OPTIONS.sort.each do |long, short, mode, desc|
- if mode == GetoptLong::REQUIRED_ARGUMENT
+ OPTIONS.sort.each do |long, *short, mode, desc|
+ case mode
+ when GetoptLong::REQUIRED_ARGUMENT
if desc =~ /\b([A-Z]{2,})\b/
long = long + "=#{$1}"
end
+ when GetoptLong::OPTIONAL_ARGUMENT
+ if desc =~ /\b([A-Z]{2,})\b/
+ long = long + "[=#{$1}]"
+ end
end
- printf " %-20s (%s)\n", long, short
+ printf " %-20s (%s)\n", long, short.join(", ")
printf " %s\n", desc
end
end