Option parse

is there a better, or different way to pipe arguments to a program
rather than using optparse? or is that the best and fastest way?

···

--
Posted via http://www.ruby-forum.com/.

Hi,

Jon Hawkins wrote:

is there a better, or different way to pipe arguments to a program
rather than using optparse? or is that the best and fastest way?

Well, there are more possiblilities:

http://www.ruby-doc.org/stdlib/libdoc/getoptlong/rdoc/index.html

http://www.ruby-doc.org/stdlib/libdoc/yaml/rdoc/index.html

But all depends on what is your meaning of "best". On the question of
speed, I think this is mainly irrelevant. You only read start up options
once.

Lutz

···

--
Posted via http://www.ruby-forum.com/\.

Check out the OptionParser gem. I find it to be simpler than optparse, though you may differ in your opinion...

···

On Aug 10, 2007, at 12:08 AM, Jon Hawkins wrote:

is there a better, or different way to pipe arguments to a program
rather than using optparse? or is that the best and fastest way?
--
Posted via http://www.ruby-forum.com/\.

--------------------------------------------|
If you're not living on the edge,
then you're just wasting space.

i prefer not to parse options, or at least i've written it one final time:

   http://codeforpeople.com/lib/ruby/main/main-0.0.2/samples/a.rb
   http://codeforpeople.com/lib/ruby/main/main-0.0.2/samples/b.rb
   http://codeforpeople.com/lib/ruby/main/main-0.0.2/samples/c.rb
   http://codeforpeople.com/lib/ruby/main/main-0.0.2/samples/d.rb

   gem install main

with main you can abstract all that repetitive stuff into a few declarative statements.

regards.

a @ http://drawohara.com/

···

On Aug 9, 2007, at 10:08 PM, Jon Hawkins wrote:

is there a better, or different way to pipe arguments to a program
rather than using optparse? or is that the best and fastest way?

--
we can deny everything, except that we have the possibility of being better. simply reflect on that.
h.h. the 14th dalai lama

# i prefer not to parse options, or at least i've written it one final
# time:
..
# with main you can abstract all that repetitive stuff into a few
# declarative statements.

how come i missed this nifty tool? was it because you named it Main, ara? :slight_smile: Nice gem really. thanks for main
kind regards -botp

···

From: ara.t.howard [mailto:ara.t.howard@gmail.com]