[tex-live] programs without --version
Karl Berry
karl at freefriends.org
Thu Apr 19 00:02:57 CEST 2012
Why do the web2c/kpathsea-programs like
pdftex accept long options not only with "--" but also with "-"?
Because I saw no gain in having explicit short options separate from the
long options. It would have meant choosing and maintaining a ton of
arbitrary option letter, which would have been a lose all around.
With GNU getopt, if you call getopt_long_only instead of getopt_long, it
automatically accepts either - or -- as the prefix. And the options can
be unambiguously abbreviated (unless you disable that feature, which we
do for some scripts, but that's another story). Hence you get -h,
-help, --h, --help all meaning the same thing, for free.
When I originally wrote the help strings and other documentation, I
consistently used --, just because it seemed clearer. Olaf then later
changed all the documentation to use -. I still think -- is better, but
didn't feel like changing everything back :). Anyway, both - and --
have always worked.
As you note, this is about the web2c/kpathsea programs.
Separately-maintained programs, for the most part, did not choose to use
getopt_long_only and hence have different behavior in one way or
another.
karl
(Sorry if my memory failed me on any of the above points ... I didn't
research it.)
More information about the tex-live
mailing list