mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Get RDoc::usage playing better with OptionParser
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4339612a14
commit
86e8e8a2f5
4 changed files with 22 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Aug 17 01:36:32 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
|
* lib/rdoc/usage.rb: Remove extra indent. Tidy 'ri' option
|
||||||
|
parsing so RDoc::usage plays better with OptionParser.
|
||||||
|
|
||||||
Sat Aug 14 02:48:16 2004 Dave Thomas <dave@pragprog.com>
|
Sat Aug 14 02:48:16 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
* lib/rdoc/usage.rb: Added. Allows command line programs
|
* lib/rdoc/usage.rb: Added. Allows command line programs
|
||||||
|
|
|
@ -12,7 +12,14 @@ class RiDriver
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@options = RI::Options.instance
|
@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
|
paths = @options.paths || RI::Paths::PATH
|
||||||
if paths.empty?
|
if paths.empty?
|
||||||
$stderr.puts "No ri documentation found in:"
|
$stderr.puts "No ri documentation found in:"
|
||||||
|
|
|
@ -187,12 +187,14 @@ module RI
|
||||||
|
|
||||||
# Parse command line options.
|
# Parse command line options.
|
||||||
|
|
||||||
def parse
|
def parse(args)
|
||||||
|
|
||||||
old_argv = ARGV.dup
|
old_argv = ARGV.dup
|
||||||
if ENV["RI"]
|
# if ENV["RI"]
|
||||||
ARGV.replace(ENV["RI"].split.concat(ARGV))
|
# ARGV.replace(ENV["RI"].split.concat(ARGV))
|
||||||
end
|
# end
|
||||||
|
|
||||||
|
ARGV.replace(args)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
|
|
@ -115,10 +115,10 @@ module RDoc
|
||||||
end
|
end
|
||||||
|
|
||||||
options = RI::Options.instance
|
options = RI::Options.instance
|
||||||
if ENV["RI"]
|
if args = ENV["RI"]
|
||||||
options.parse
|
options.parse(args.split)
|
||||||
end
|
end
|
||||||
formatter = options.formatter.new(options, " ")
|
formatter = options.formatter.new(options, "")
|
||||||
formatter.display_flow(flow)
|
formatter.display_flow(flow)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue