R
Rich Morin
I'm a bit confused by the way that OptionParser works. In
the "Complete example" on
http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html
I see
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
...
It looks like the "opts" object is being handed to the block,
as well as being returned as the result of the "new" method.
Is this the case? Is this a common way of doing things? Are
there any caveats that must be observed in this situation?
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume (e-mail address removed)
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development
the "Complete example" on
http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html
I see
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
...
It looks like the "opts" object is being handed to the block,
as well as being returned as the result of the "new" method.
Is this the case? Is this a common way of doing things? Are
there any caveats that must be observed in this situation?
-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume (e-mail address removed)
http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development