diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-16 16:41:21 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-16 16:41:21 +0000 |
commit | 07e8a84316bf2b7bec3a57d7f25e9630e16e321a (patch) | |
tree | 95be9118a24dc2d97eda50472156631607e2a1e5 /lib/rdoc | |
parent | db4338068a0360ac244d38938261451b76ad720a (diff) | |
download | ruby-07e8a84316bf2b7bec3a57d7f25e9630e16e321a.tar.gz ruby-07e8a84316bf2b7bec3a57d7f25e9630e16e321a.tar.xz ruby-07e8a84316bf2b7bec3a57d7f25e9630e16e321a.zip |
Get RDoc::usage playing better with OptionParser
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/ri/ri_driver.rb | 9 | ||||
-rw-r--r-- | lib/rdoc/ri/ri_options.rb | 10 | ||||
-rw-r--r-- | lib/rdoc/usage.rb | 6 |
3 files changed, 17 insertions, 8 deletions
diff --git a/lib/rdoc/ri/ri_driver.rb b/lib/rdoc/ri/ri_driver.rb index afefa67dc..35c20a7a1 100644 --- a/lib/rdoc/ri/ri_driver.rb +++ b/lib/rdoc/ri/ri_driver.rb @@ -12,7 +12,14 @@ class RiDriver def initialize @options = RI::Options.instance - @options.parse + + args = ARGV + if ENV["RI"] + args = ENV["RI"].split.concat(ARGV) + end + + @options.parse(args) + paths = @options.paths || RI::Paths::PATH if paths.empty? $stderr.puts "No ri documentation found in:" diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb index b53a68812..ba420344f 100644 --- a/lib/rdoc/ri/ri_options.rb +++ b/lib/rdoc/ri/ri_options.rb @@ -187,12 +187,14 @@ module RI # Parse command line options. - def parse + def parse(args) old_argv = ARGV.dup - if ENV["RI"] - ARGV.replace(ENV["RI"].split.concat(ARGV)) - end +# if ENV["RI"] +# ARGV.replace(ENV["RI"].split.concat(ARGV)) +# end + + ARGV.replace(args) begin diff --git a/lib/rdoc/usage.rb b/lib/rdoc/usage.rb index afc9006ba..73821dfae 100644 --- a/lib/rdoc/usage.rb +++ b/lib/rdoc/usage.rb @@ -115,10 +115,10 @@ module RDoc end options = RI::Options.instance - if ENV["RI"] - options.parse + if args = ENV["RI"] + options.parse(args.split) end - formatter = options.formatter.new(options, " ") + formatter = options.formatter.new(options, "") formatter.display_flow(flow) end |