@@ -77,14 +77,12 @@ def message
77
77
78
78
attr_accessor :homepath # :nodoc:
79
79
80
- def self . process_args ( argv )
80
+ def self . default_options
81
81
options = { }
82
82
options [ :use_stdout ] = !$stdout. tty?
83
83
options [ :width ] = 72
84
84
options [ :formatter ] = RDoc ::RI ::Formatter . for 'plain'
85
85
options [ :interactive ] = false
86
- options [ :list_classes ] = false
87
- options [ :list_names ] = false
88
86
options [ :use_cache ] = true
89
87
90
88
# By default all standard paths are used.
@@ -94,6 +92,12 @@ def self.process_args(argv)
94
92
options [ :use_gems ] = true
95
93
options [ :extra_doc_dirs ] = [ ]
96
94
95
+ return options
96
+ end
97
+
98
+ def self . process_args ( argv )
99
+ options = default_options
100
+
97
101
opts = OptionParser . new do |opt |
98
102
opt . program_name = File . basename $0
99
103
opt . version = RDoc ::VERSION
@@ -152,14 +156,6 @@ def self.process_args(argv)
152
156
opt . separator "Options:"
153
157
opt . separator nil
154
158
155
- opt . on ( "--classes" , "-c" ,
156
- "Display the names of classes and modules we" ,
157
- "know about." ) do |value |
158
- options [ :list_classes ] = value
159
- end
160
-
161
- opt . separator nil
162
-
163
159
opt . on ( "--fmt=FORMAT" , "--format=FORMAT" , "-f" ,
164
160
RDoc ::RI ::Formatter ::FORMATTERS . keys ,
165
161
"Format to use when displaying output:" ,
@@ -252,14 +248,6 @@ def self.process_args(argv)
252
248
253
249
opt . separator nil
254
250
255
- opt . on ( "--list-names" , "-l" ,
256
- "List all the names known to RDoc, one per" ,
257
- "line." ) do
258
- options [ :list_names ] = true
259
- end
260
-
261
- opt . separator nil
262
-
263
251
opt . on ( "--no-pager" , "-T" ,
264
252
"Send output directly to stdout," ,
265
253
"rather than to a pager." ) do
@@ -312,19 +300,12 @@ def self.run(argv = ARGV)
312
300
ri . run
313
301
end
314
302
315
- def initialize ( options = { } )
316
- @names = options [ :names ]
317
-
318
- options [ :formatter ] ||= RDoc ::RI ::Formatter
303
+ def initialize ( initial_options = { } )
304
+ options = self . class . default_options . update ( initial_options )
319
305
306
+ @names = options [ :names ]
320
307
@class_cache_name = 'classes'
321
308
322
- options [ :use_system ] = true
323
- options [ :use_site ] = true
324
- options [ :use_home ] = true
325
- options [ :use_gems ] = true
326
- options [ :use_cache ] = true
327
-
328
309
@doc_dirs = RDoc ::RI ::Paths . path ( options [ :use_system ] ,
329
310
options [ :use_site ] ,
330
311
options [ :use_home ] ,
0 commit comments