aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-13 17:52:52 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-13 17:52:52 +0000
commit3319ea129ea921cde08aa1033abb3084069d6100 (patch)
treeff7c99c2e7265af5b6e5b12db92531a52c25c743
parent690face91a21878fc96bf31b63b5288054186809 (diff)
downloadruby-3319ea129ea921cde08aa1033abb3084069d6100.tar.gz
Add "usage" interface
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--MANIFEST1
-rw-r--r--lib/rdoc/markup/simple_markup/to_flow.rb2
-rw-r--r--lib/rdoc/ri/ri_options.rb11
4 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f0ca0b594e..46a763714a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Aug 14 02:48:16 2004 Dave Thomas <dave@pragprog.com>
+
+ * lib/rdoc/usage.rb: Added. Allows command line programs
+ to report usage using their initial RDoc comment.
+
Sat Aug 14 01:25:48 2004 why the lucky stiff <why@ruby-lang.org>
* ext/syck/token.c: re2c no longer compiled with bit vectors. caused
diff --git a/MANIFEST b/MANIFEST
index c7034f94e0..eaa424ffd3 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -292,6 +292,7 @@ lib/rdoc/ri/ri_util.rb
lib/rdoc/ri/ri_writer.rb
lib/rdoc/template.rb
lib/rdoc/tokenstream.rb
+lib/rdoc/usage.rb
lib/readbytes.rb
lib/resolv-replace.rb
lib/resolv.rb
diff --git a/lib/rdoc/markup/simple_markup/to_flow.rb b/lib/rdoc/markup/simple_markup/to_flow.rb
index d5f6732d5c..ce366d2df7 100644
--- a/lib/rdoc/markup/simple_markup/to_flow.rb
+++ b/lib/rdoc/markup/simple_markup/to_flow.rb
@@ -1,6 +1,6 @@
require 'rdoc/markup/simple_markup/fragments'
require 'rdoc/markup/simple_markup/inline'
-
+require 'CGI'
module SM
diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb
index 4c8531aa47..b53a688126 100644
--- a/lib/rdoc/ri/ri_options.rb
+++ b/lib/rdoc/ri/ri_options.rb
@@ -176,16 +176,19 @@ module RI
end
- # Parse command line options.
-
- def parse
-
+ def initialize
@use_stdout = !STDOUT.tty?
@width = 72
@formatter = RI::TextFormatter.for("plain")
@list_classes = false
@list_names = false
+ end
+
+ # Parse command line options.
+
+ def parse
+
old_argv = ARGV.dup
if ENV["RI"]
ARGV.replace(ENV["RI"].split.concat(ARGV))