IIRC, they liked the plus, but changed to use the double dash to be POSIX compatible (which presumably requires options to be preceded by a dash).
Unix command line conventions over time
11–20 of 222 posts
Re: Unix command line conventions over time
#12Re: Unix command line conventions over time
#131. no-valued option: --example 2. single-valued option: --key=value 3. multi-valued option: --elements:1st --elements:2nd
Short options are ruled out, although it accepts the short option -h for discoverability.
I particularly like the repeated option pattern for multi-valued options. This avoids ambiguities such as:
cli --elements 1st 2nd arg
Yes, the ambiguity may be removed by using doubled dashes. However, this is error-prone.I often wondering whether a more familiar syntax for the second and third kinds could be adopted. For instance:
--key value
--elements 1st --elements 2nd
[1] https://github.com/evanw/esbuildRe: Unix command line conventions over time
#14Is it really difficult to learn that e.g. "rm" stands for "remove"? I've known very few people who found it difficult to learn the key things very quickly.
And not having to type (and spell) full words is a relief. (I know a shell can take care of spelling, but not all unix commands are entered interactively.)
Still, the article is interesting, and worth reading.
Re: Unix command line conventions over time
#15And then there is also the case of CLIs that aren’t written in C: they don’t get the benefits of a unified getopts lib. One oddity not explained is tar allowing multi options crammed together without any dash, that nobody can ever remember (eg. tar xvf archive.tar)
Re: Unix command line conventions over time
#16The GNU conventions are terribly convenient. If we were redesigning it from scratch, I'd like to keep all of them except for removing duplicated functionality. One of --long x and --long=x have to go, and that means we only can keep --long=x. And so on.
Just wondering: why `--long=x` over `--long x`?
Re: Unix command line conventions over time
#17GNU keeps a list of them, so that anyone implementing a similar functionality should use the same option if it already exists:
https://www.gnu.org/prep/standards/standards.html#Option-Tab...
Re: Unix command line conventions over time
#18The GNU conventions are terribly convenient. If we were redesigning it from scratch, I'd like to keep all of them except for removing duplicated functionality. One of --long x and --long=x have to go, and that means we only can keep --long=x. And so on.
> that means we only can keep --long=x Just wondering: why `--long=x` over `--long x`?
Re: Unix command line conventions over time
#19The GNU conventions are terribly convenient. If we were redesigning it from scratch, I'd like to keep all of them except for removing duplicated functionality. One of --long x and --long=x have to go, and that means we only can keep --long=x. And so on.
> that means we only can keep --long=x Just wondering: why `--long=x` over `--long x`?
Re: Unix command line conventions over time
#20The GNU conventions are terribly convenient. If we were redesigning it from scratch, I'd like to keep all of them except for removing duplicated functionality. One of --long x and --long=x have to go, and that means we only can keep --long=x. And so on.
> that means we only can keep --long=x Just wondering: why `--long=x` over `--long x`?