getopt: where's da dicts?????

D'Arcy J.M. Cain darcy at vex.net
Wed Oct 20 11:58:55 EDT 1999


Fred L. Drake, Jr. <fdrake at acm.org> wrote:
> Aahz Maruch writes:
>  > Depends whether you allow "-v 1" or "-v1".
>   Since the current behavior of getopt is to allow both, I'd be
> inclined to keep it that way.  There are lots of applications that
> already allow both (Python & otherwise; I don't think it's original
> behavior with getopt), I'm inclined to allow both rather than just
> one, and wouldn't want optional arguments to screw that up.

It is possible to add optional arguments without messing up regular
use.  You just have to put restrictions on the use of flags that
take optional arguments but that's fine in an extension anyway.  See
my getopt C program at http://www.druid.net/~darcy/files/getarg.c for
an example of this in action.

-- 
D'Arcy J.M. Cain <darcy at caingang.com>      |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on         
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.




More information about the Python-list mailing list