aboutsummaryrefslogtreecommitdiffstats
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.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb
index 8e3d97edd3..7f1fb486e0 100644
--- a/lib/rubygems/commands/help_command.rb
+++ b/lib/rubygems/commands/help_command.rb
@@ -113,7 +113,15 @@ platform.
format = "#{' ' * margin_width}%-#{desc_width}s%s"
command_manager.command_names.each do |cmd_name|
- summary = command_manager[cmd_name].summary
+ command = command_manager[cmd_name]
+
+ summary =
+ if command then
+ command.summary
+ else
+ "[No command found for #{cmd_name}, bug?]"
+ end
+
summary = wrap(summary, summary_width).split "\n"
out << sprintf(format, cmd_name, summary.shift)
until summary.empty? do