On 04 Jun 2005, at 18:00, a slow loriswithpoisonelbows wrote:

> Eric Hodel <drbrain / segment7.net> writes:
>
>> 6 lines too many (counting my shebang with -s):
>>
>
> Sure, if -s is sufficient for your purposes.

Exactly, when -s is sufficient, optparse is overkill.  When it is  
insufficient, optparse works great.

> As for me, I don't like how it clobbers globals.  What if someone
> invokes your -s enabled script with the option '-stdout' ?

Then that someone hasn't read -h, which is tough for them.  If people  
want to specify undocumented options to scripts they can live with  
the consequences.

> Well, I guess I don't understand the issue. optparse is concise
> enough for me, in comparison with other means of parsing options
> like getoptlong.

I use the simplest thing that works.  Sometimes that is ruby -s,  
other times that is optparse, and other times it is if ARGV.first ==  
"-e" then ... end.  I wish I could use optparse all the time, but it  
often involves too much typing for too little gain.

-- 
Eric Hodel - drbrain / segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04