[Pdx-pm] Getopt::Modern usage model

Eric Wilhelm ewilhelm at sbcglobal.net
Fri Jun 10 00:39:05 PDT 2005


# The following was supposedly scribed by
# Austin Schutz
# on Thursday 09 June 2005 09:49 pm:

>Come to think of it, I don't see why you need to monkey with it
>at all. If the author wants to interpolate ~ all they have to do is
>s/^~/$ENV{HOME}/. Document it as a gotcha for the author to be aware
> of. 

But it's really a gotcha for the user, which is just one more thing for 
the author to have to document.

> Also by doing that you can pass off responsibility for cases 
> where the user didn't want shell interpolation, --foo='~' or similar.
> Otherwise there's no way of knowing. Actually, that makes it a good
> excuse for calling this "the right thing to do", which I would
> propose that it is.

It's actually starting to sound like this is a good reason to call the 
--whole=thing off.  If the user doesn't want shell expansion, they 
can act accordingly.

Also, I was thinking that the issue actually involved all sorts of shell 
expansion, but it looks like it only really involves the ~.

However, it still introduces a few inconsistencies.

  --this=a{d,c,b}e   ne   --this a{d,c,b}e

> Otherwise there's no way of knowing.

I think the best way of knowing is to not go there.  --this '~' allows 
the user to be very clear about what they mean and I don't see why any 
program or module should second-guess that.  If --this=~ is supposed to 
be treated in a special way (which is actually a work-around to the way 
the shell treats words), then I don't think it's going to be worth the 
extra code.

If I don't try to make everyone happy, the module is unused.  If I do 
it's useless right?

--Eric
-- 
"If you only know how to use a hammer, every problem begins to look like 
a nail." 
                                       -- Richard B. Johnson
---------------------------------------------
    http://scratchcomputing.com
---------------------------------------------



More information about the Pdx-pm-list mailing list