[tex-k] - vs. -- for options

Tomas G. Rokicki rokicki at CS.Stanford.EDU
Tue Jan 6 00:51:41 CET 2004


There's a significant reason for --.  Traditionally Unix options
could be combined, hence

   ls -alt

is the same as

   ls -a -l -t

If there was a long option named "--all", we wouldn't want 
to accept -all as a synonym because that would introduce ambiguity.

The ability to combine single-letter options is not uniformly
implemented, even among Unix utilities.

(And then there's win2k, where you can, for instance, say
xcopy /y, and xcopy /-y . . . as well as tar, where the - is
unnecessary before the first option since some option is
required . . . and many programs allow - as a synonym for
stdin and/or stdout where a filename would normally be
specified . . . and then there's -- which by itself usually
indicates an end to the options so you can specify arguments
starting with hyphens . . .)


More information about the tex-k mailing list