From e147632bffc50fd33f5b5d6f5716e3627985c0d1 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 24 Mar 2004 19:17:42 +0000 Subject: Add the --list-names option git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/ri/ri_display.rb | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'lib/rdoc/ri/ri_display.rb') diff --git a/lib/rdoc/ri/ri_display.rb b/lib/rdoc/ri/ri_display.rb index 1e371350dc..8e5d07ee6c 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 ###################################################################### @@ -236,5 +247,10 @@ class DefaultDisplay end end - + ###################################################################### + + def warn_no_database + puts "Before using ri, you need to generate documentation" + puts "using 'rdoc' with the --ri option" + end end # class RiDisplay -- cgit v1.2.3