[getopt-sig] RE: [Python-Dev] a different approach to argument parsing

Tim Peters tim.one@comcast.net
Tue, 12 Feb 2002 16:13:38 -0500


[Russ Cox, on the Plan9-ish approach]
> ...
> For concreteness, I'd much rather write:
>
> 	if o=='-n' or o=='--num':
> 		ncopies = opt.optarg(opt.needtype(int))

If a commandline has

    -abc

then can you-- with only finite pain --manage to treat it as if it were

    -a -b -c

?  Or doesn't this scheme support collapsing multiple single-letter
arguments (where "support" == "finite pain")?  If the option parser isn't
told in advance what the possible options are, it seems like it couldn't
help in this case.  Or is it that Plan 9 doesn't support options with names
longer than one character?

> ...
> [This is documented at
> http://plan9.bell-labs.com/magic/man2html/2/ARGBEGIN,
> for anyone who is curious.]

I tried, but that link was a 404 for me.