diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-24 19:17:42 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-24 19:17:42 +0000 |
commit | 3ae6e3ccbf0d51c6f90a3e4f95d81a46e304a66b (patch) | |
tree | 78419a54f87aee17e7f6a79f65b166d26f3dc010 /lib/rdoc/ri/ri_options.rb | |
parent | aa8658f7b145db8afd19f96e329438aeee08bd0d (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_options.rb')
-rw-r--r-- | lib/rdoc/ri/ri_options.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb index 8aec57e9a1..d9ece2067c 100644 --- a/lib/rdoc/ri/ri_options.rb +++ b/lib/rdoc/ri/ri_options.rb @@ -21,6 +21,9 @@ module RI # should we just display a class list and exit attr_reader :list_classes + # should we display a list of all names + attr_reader :list_names + # The width of the output line attr_reader :width @@ -52,6 +55,10 @@ module RI "tell your pager to allow control characters\n" + "(for example using the -R option to less)"], + [ "--list-names", "-l", nil, + "List all the names known to RDoc, one per line" + ], + [ "--no-pager", "-T", nil, "Send output directly to stdout." ], @@ -163,7 +170,8 @@ module RI @use_stdout = !STDOUT.tty? @width = 72 @formatter = RI::TextFormatter.for("plain") - @list_classes = false + @list_classes = false + @list_names = false old_argv = ARGV.dup if ENV["RI"] @@ -177,10 +185,11 @@ module RI go.each do |opt, arg| case opt - when "--help" then OptionList.usage - when "--no-pager" then @use_stdout = true - when "--classes" then @list_classes = true - when "--doc-dir" then @doc_dir = arg + when "--help" then OptionList.usage + when "--list-names" then @list_names = true + when "--no-pager" then @use_stdout = true + when "--classes" then @list_classes = true + when "--doc-dir" then @doc_dir = arg when "--format" @formatter = RI::TextFormatter.for(arg) |