Arg decoding with a template?

Peter Wang pzw1 at spam.me.please.hotmail.com
Tue Jul 31 17:29:06 EDT 2001


On Tue, 31 Jul 2001 18:01:57 +0100, Dale Strickland-Clark
<dale at riverhall.NOSPAMco.uk> wrote:

>"Steve Holden" <sholden at holdenweb.com> wrote:
>
>OK, I've had a good look at this now.
>
>It's hideous!

i believe the euphemism is "legacied". :)

>It's no wonder that people get fed up with computers if they get given a user interface that expects
>pointless dashes all over the place.

actually, the GNU getopt package uses standard UNIX argument-passing
paradigms.  so for the UNIX users, this interface is quite natural.
("ease of use" is always a relative measure!)

>You simply can't use this routine to code a nice arg string.

after looking at your original post, i'm not exactly sure what you
want.  do you want a function which can pass a template, as thus?

	parse_args("val1=%d val2=%s val3=%f", arg_string)

if so, then you're going to need a much more strict semantic system
for defining the template.  what delimiters are used for strings?  how
do you indicate strings should be interpreted as values and not as
literals?  etc.

perhaps if you gave an example of what you're looking for, better help
could be provided.

you could also write your own, and submit it to the vaults.  although
i'm afraid that you'll be fighting twenty some-odd years of UNIX
command-line tradition, and this will render your interface less
friendly to the vast majority of UNIX-heads.  it all depends on your
target audience, i suppose.


-peter



More information about the Python-list mailing list