summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/ri_display.rb
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-24 19:17:42 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-24 19:17:42 +0000
commit3ae6e3ccbf0d51c6f90a3e4f95d81a46e304a66b (patch)
tree78419a54f87aee17e7f6a79f65b166d26f3dc010 /lib/rdoc/ri/ri_display.rb
parentaa8658f7b145db8afd19f96e329438aeee08bd0d (diff)
Add the --list-names option
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri/ri_display.rb')
-rw-r--r--lib/rdoc/ri/ri_display.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/rdoc/ri/ri_display.rb b/lib/rdoc/ri/ri_display.rb
index 8533aba822..076df46b17 100644
--- a/lib/rdoc/ri/ri_display.rb
+++ b/lib/rdoc/ri/ri_display.rb
@@ -165,8 +165,7 @@ class DefaultDisplay
def list_known_classes(classes)
if classes.empty?
- puts "Before using ri, you need to generate documentation"
- puts "using 'rdoc' with the --ri option"
+ warn_no_database
else
page do
@formatter.draw_line("Known classes and modules")
@@ -178,6 +177,18 @@ class DefaultDisplay
######################################################################
+ def list_known_names(names)
+ if names.empty?
+ warn_no_database
+ else
+ page do
+ names.each {|n| @formatter.raw_print_line(n)}
+ end
+ end
+ end
+
+ ######################################################################
+
private
######################################################################
@@ -242,7 +253,12 @@ class DefaultDisplay
@formatter.break_to_newline
end
end
-
+ ######################################################################
+
+ def warn_no_database
+ puts "Before using ri, you need to generate documentation"
+ puts "using 'rdoc' with the --ri option"
+ end
######################################################################
def display_flow(flow)