> Initially, GNU used the plus (+) to indicate a long option Some tools still use +options, like dig(1).
Also in some cases both -options and +options exist, where +options do the inverse of -options (e.g. dash; I think the old Perl 6 also did the same thing for sub MAIN, though it's now -/options) or a subtle but useful variation of -options (e.g. ImageMagick).
Unix command line conventions over time
51–60 of 222 posts
Re: Unix command line conventions over time
#52Earlier quoted context omitted.
I disagree with getting rid of `--long x`. It's really common to build command argvs programmatically, where you have a string representing some option (such as a file path), and you need to pass that as a long option. With `--long x`, you can do like: char *argv[] = {"my-program", "--config-file", config_file, NULL}; run_command(argv); With only `--config-file=x`, you would have to allocate memory for the option: ch…
If all of this matters so much, don’t use an (interactive) shell.
Re: Unix command line conventions over time
#53Earlier quoted context omitted.
Also in some cases both -options and +options exist, where +options do the inverse of -options (e.g. dash; I think the old Perl 6 also did the same thing for sub MAIN, though it's now -/options) or a subtle but useful variation of -options (e.g. ImageMagick).
Dash just implements the behavior specified by POSIX/SUS.
Re: Unix command line conventions over time
#54The chronology is wrong. dash-options came before pipes. The first edition already has them while pipes came in the third edition.
du [-s] [-a] [name ...]
ld [-usaol] name ]
ls [-ltasd] name ...
pr [-lcm] nameRe: Unix command line conventions over time
#55Earlier quoted context omitted.
> that means we only can keep --long=x Just wondering: why `--long=x` over `--long x`?
`--long x` is potentially ambiguous. `x` could be referring to a file if `--long` doesn't take any options, so parsing it correctly depends on this knowledge. The equals sign removes this ambiguity.
Re: Unix command line conventions over time
#56Re: Unix command line conventions over time
#57Earlier quoted context omitted.
> One oddity not explained is tar allowing multi options crammed together without any dash, that nobody can ever remember (eg. tar xvf archive.tar) This is a BSDism, and it's deprecated even there. bsdtar allows it for compatibility with old scripts. GNUtar has long-switches for all options, which makes it considerably easier to use and understand, for example: gtar --create --file etc.tar --verbose /etc
> This is a BSDism No, it was like that when Tar was first introduced, as part of Seventh Edition Unix: https://man.cat-v.org/unix_7th/1/tar https://en.wikipedia.org/wiki/Tar_(computing)
> tap [key] [name ...]
> The function portion of the key is specified by one of the following letters ...
For example, "x" to extract.
> The following characters may be used in addition to the letter which selects the function desired
For example, "v" for verbose.
Re: Unix command line conventions over time
#58And then you have ImageMagick where the order of flags and options is a science by itself.
EDIT: also why is `ps` default output so useless? With no arguments it only prints a couple processes and that's it. I have no idea what it's supposed to show me. Talk about bad UX.
Re: Unix command line conventions over time
#59And then you have ImageMagick where the order of flags and options is a science by itself.
Re: Unix command line conventions over time
#60And then you have ImageMagick where the order of flags and options is a science by itself.
Indeed, I passionately hate programs where the order of the options and files/arguments matter just as much as the options themselves.
The exact same holds for ffmpeg command-line.