* 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
Родитель 24aba08054
Коммит b3b121496f
2 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

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

Просмотреть файл

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