Arg decoding with a template?
Hans-Joachim Widmaier
hjwidmaier at web.de
Wed Aug 1 07:28:01 EDT 2001
"Steve Holden" <sholden at holdenweb.com> wrote in message
>
> Was this the one that allowed to you define command lines like
>
> COPY FROM <file> TO <file>
>
> and variations could be deduced from the noise words? I seem to remember a
> college chum of mine working in BCPL with a scheme like this, circa 1978,
> but have only this fading memory.
Yes. I had several Amigas for several years and I always loved those
command lines. The nice thing about it was that you could give
arguments by name and/or position:
COPY <file> <file>
COPY TO <file> FROM <file>
Sometimes this was rather convenient, e.g. if you had to repeat a
command a few times and change an argument (not often enough for a
loop or script, though).
You'd just hit Cursor-Up, Ctrl-W and type in the new argument.
And it looked nice, at least nicer than '-', '--' or '/'. The letters
are also easier to reach on the keyboard.
I would have written a parser for this under Unix, but I prefer to
have a consistent interface, which means basically getopt() (though I
did write my own C getopt()).
Hans-J.
More information about the Python-list
mailing list