1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2008-08-30 01:42:03 +00:00
parent 24aba08054
commit b3b121496f
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sat Aug 30 10:41:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rake.rb (Rake::Application#help): fix for OPTIONAL_ARGUMENT and
multiple short options. [ruby-dev:36051]
Sat Aug 30 08:59:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/intern.h (rb_file_s_absolute_path),

View file

@ -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