Project

General

Profile

Actions

Bug #6997

closed

Improve documentation for OptionParser

Added by eike.rb (Eike Dierks) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Assignee:
Target version:
ruby -v:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10]
Backport:
[ruby-core:47460]

Description

The documentation for OptionParser should be improved.

The current examples and and documentation do not yet describe
how to access non option args

I suggest to change the simple example in the doc as follows:

opts.banner = "Usage: example.rb [options] file ..."

p "files:" + ARGV

It should be stated explicitely in the description,
that parse! modifies the ARGV and removes all parseable args.

At least that is how I believe that the OptionParser.parse! works?
not yet tried it myself


Files

rdoc_lib_optparse.patch (1.29 KB) rdoc_lib_optparse.patch stomar (Marcus Stollsteimer), 12/22/2012 07:51 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0