[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

option parse

Michael Linfield

8/10/2007 4:09:00 AM

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

4 Answers

Lutz Horn

8/10/2007 6:04:00 AM

0

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

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

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

Ari Brown

8/14/2007 9:00:00 PM

0

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

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



ara.t.howard

8/16/2007 3:19:00 PM

0


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?

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/sa...
http://codeforpeople.com/lib/ruby/main/main-0.0.2/sa...
http://codeforpeople.com/lib/ruby/main/main-0.0.2/sa...
http://codeforpeople.com/lib/ruby/main/main-0.0.2/sa...

gem install main

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

regards.

a @ http://draw...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




Peña, Botp

8/17/2007 3:24:00 AM

0

From: ara.t.howard [mailto:ara.t.howard@gmail.com]
# 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? :) Nice gem really. thanks for main
kind regards -botp