diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
commit | e2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch) | |
tree | 942e66e071e759c7db670a42daeac26c7437f25b /lib/rdoc/options.rb | |
parent | 90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff) |
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/options.rb')
-rw-r--r-- | lib/rdoc/options.rb | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 810f7fac0a..3d76569a7e 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -241,6 +241,32 @@ class RDoc::Options end ## + # Returns a properly-space list of generators and their descriptions. + + def generator_descriptions + lengths = [] + + generators = RDoc::RDoc::GENERATORS.map do |name, generator| + lengths << name.length + + description = generator::DESCRIPTION if + generator.const_defined? :DESCRIPTION + + [name, description] + end + + longest = lengths.max + + generators.sort.map do |name, description| + if description then + " %-*s - %s" % [longest, name, description] + else + " #{name}" + end + end.join "\n" + end + + ## # Parse command line options. def parse(argv) @@ -274,8 +300,9 @@ Usage: #{opt.program_name} [options] [names...] will make rdoc show hashes in method links by default. Command-line options always will override those in RDOCOPT. - - Darkfish creates frameless HTML output by Michael Granger. - - ri creates ri data files + Available formatters: + +#{generator_descriptions} RDoc understands the following file formats: |