[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PLT conformance, multi-arg flags, and spaces before arguments
> I feel somewhat passionately for GNU/POSIX-style command-line
> processing. After a few weeks' absence from PLT Scheme, I usually
> have to read the docs to actually believe they've done this
> differently from everyone else. I find PLT's way of doing things
> unnecessarily hard to remember.
Where our library differs from Posix, it's mostly a result of
ignorance. I wrote the library 5 years ago, and at that time I searched
the web and consulted as many people as I could. Matching a standard
(any standard!) was a priority. I was under the misimpression that we
I, too, feel strongly about argument parsing --- and I've called Apple
bad names because they completely ignored Posix conventions for OS X
tools. I guess I have to stop that, now.
I don't think that PLT's (lib "cmdline.ss") needs to be implemented
with SRFI-37 or vice-versa, but I am certainly interested in having a
consistent parsing. Allowing an "=" between a long-argument name and
its first argument is easy and backward-compatible. I have some issues
and questions with other changes.
On parsing multiple flag arguments:
I still feel free to call Microsoft bad names. The Windows implementors
ignored the Unix argv experience, and Windows instead provides a single
command-line string that an application must parse. Parsers differ, and
many applications get either command-line construction or parsing
wrong. (How many times have you seen an app trip over a path with a
space in it? I still see it all the time.) I mention this because it
seems like employing " " or "," as a flag-argument delimitter (e.g.,
for -L in MzScheme) would be making that same mistake again. But Posix
also has experience behind it, so what am I missing?
On combining a flag and its argument:
The other troublesome change for us would be allowing a flag's argument
to be combined with the flag (i.e., leaving out the space). This seems
to be a deprecated convention. (Posix guideline 6 says "don't do it,
but you can if you want". The SRFI says "for historical reasons".) Is
there strong support for continuing it?
The SRFI seems to depart from both Posix and GNU (as documented) in
allowing multiple flag names to follow "-" *and* argument without a
space for the last flag. Is that actually supported by GNU, and/or am I
overlooking something in the Posix guidelines?