From: "zzak (Zachary Scott)" <zachary@...>
Date: 2012-12-23T01:38:45+09:00
Subject: [ruby-core:51077] [ruby-trunk - Bug #6997] Improve documentation for OptionParser


Issue #6997 has been updated by zzak (Zachary Scott).


Thanks Marcus, I was holding off on this until I got around to some other patches I have in mind for OptionParser, but you beat me to it :)

Re: remove further documentation: I think we should keep it, it doesn't hurt to mention the tracker if anyone comes across any bugs it will probably be documentation related when reading the optparse docs.
----------------------------------------
Bug #6997: Improve documentation for OptionParser
https://bugs.ruby-lang.org/issues/6997#change-35013

Author: eike.rb (Eike Dierks)
Status: Closed
Priority: Normal
Assignee: zzak (Zachary Scott)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10]


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












-- 
http://bugs.ruby-lang.org/