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?

Hi,

Jon H. 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

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 H. 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.

From: ara.t.howard [mailto:[email protected]]

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

On Aug 9, 2007, at 10:08 PM, Jon H. 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?

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/