@@ -11,25 +11,32 @@ parser = OptionParser.new
1111
1212parser . version = RDoc ::VERSION
1313parser . banner = <<-BANNER
14- Command to open the web page for Ruby documentation
15- (page, class, module, or method).
14+ webri is a console application for accessing Ruby online HTML documentation.
1615
1716Usage: #{ parser . program_name } [options] name
1817
19- where name specifies one or more pages, classes, modules, or methods .
18+ Argument name selects the documentation to be accessed .
2019
21- If name specifies a single item, the page for that item is opened;
22- if it specifies multiple items, the names of those specific items are displayed,
23- and the user may choose among them.
20+ o If name specifies a single item, that item is selected.
21+ o If name specifies multiple items, those items are displayed.
2422
25- The given name is converted to a Regexp, which is used to select
26- the items for consideration.
23+ The given name is converted to a Regexp, which is used to select documentation.
2724
2825Note that your command window may require you to escape certain characters;
2926in particular, you may need to escape circumflex (^), dollar sign ($),
3027and pound sign (#).
28+
3129BANNER
3230
31+ parser . separator ( 'Options:' )
32+ parser . on ( '-r' , '--release=STR' ,
33+ 'Sets the target documentation release to STR.' ,
34+ 'If not given, uses the release of the installed Ruby' ,
35+ "(currently #{ RUBY_VERSION } )." ,
36+ 'If given and not valid, the valid releases are displayed.' ,
37+ ) do |release |
38+ options [ :release ] = release
39+ end
3340parser . on ( '-h' , '--help' , 'Prints this help.' ) do
3441 puts parser
3542 exit
@@ -38,14 +45,6 @@ parser.on('-v', '--version', 'Prints the version of webri.') do
3845 puts RDoc ::VERSION
3946 exit
4047end
41- parser . on ( '-r' , '--release=STR' ,
42- 'Sets desired documentation release to STR.' ,
43- "If not given, uses the release of the installed Ruby (#{ RUBY_VERSION } )." ,
44- 'If given and not valid, the valid releases are displayed,' ,
45- 'and the user may choose among them.' ,
46- ) do |release |
47- options [ :release ] = release
48- end
4948parser . parse!
5049
5150error_message = case ARGV . size
0 commit comments