summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/help_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/help_command.rb')
-rw-r--r--lib/rubygems/commands/help_command.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb
index 0c96963fac..9f14e22f90 100644
--- a/lib/rubygems/commands/help_command.rb
+++ b/lib/rubygems/commands/help_command.rb
@@ -297,8 +297,8 @@ platform.
begins? command, arg
end
- if help then
- if Symbol === help then
+ if help
+ if Symbol === help
send help
else
say help
@@ -306,10 +306,10 @@ platform.
return
end
- if options[:help] then
+ if options[:help]
show_help
- elsif arg then
+ elsif arg
show_command_help arg
else
@@ -334,7 +334,7 @@ platform.
command = @command_manager[cmd_name]
summary =
- if command then
+ if command
command.summary
else
"[No command found for #{cmd_name}]"
@@ -356,15 +356,15 @@ platform.
say out.join("\n")
end
- def show_command_help command_name # :nodoc:
+ def show_command_help(command_name) # :nodoc:
command_name = command_name.downcase
possibilities = @command_manager.find_command_possibilities command_name
- if possibilities.size == 1 then
+ if possibilities.size == 1
command = @command_manager[possibilities.first]
command.invoke("--help")
- elsif possibilities.size > 1 then
+ elsif possibilities.size > 1
alert_warning "Ambiguous command #{command_name} (#{possibilities.join(', ')})"
else
alert_warning "Unknown command #{command_name}. Try: gem help commands"
@@ -372,4 +372,3 @@ platform.
end
end
-