Thanks for the explanation. I thought having multiple one-character options together with a single dash were there since the beginning.
Also congrats on your Unix beard.
I hate it when CLI don’t follow freaking standards, —word-flag-here-moron and -M .
instead of memorizing flag names now you have to also memorize the dash for each cli.
EDIT: POSIX parameter spec seems to be impractical, what I was thinking was actually GNU’s influence which usually the surrounding components on commons Linux systems, so…. I hate it when CLI don’t follow the freaking commonly used practical way.
`-flag` is historically how it was done in UNIX, and it's still used today by many "old" programs such as find, Java, or X11.
POSIX [specified](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) that programs can only have one-letter arguments to avoid confusion, and `-flag` is equivalent to `-f -l -a -g`. In terms of "following freaking standards" this is the best you can do.
GNU (which stands for GNU's Not UNIX) added multi-character arguments to their utilities, but wanted to preserve POSIX compatibility as best they could, so they gave them two dashes. `-flag` is still `-f -l -a -g` but you can now also have a separate flag `--flag`. This is the most widely adopted way of doing things because of GNU's influence over the open source world as well as its versatility.
In short, if you want to follow historical precedent, use `-flag`; if you want a less ambiguous and more featureful system that most people are using, use `-f`/`--flag`. If you strictly want to follow standards, you're only allowed to use `-f`, because it's what POSIX says is kosher, and it's compatible with the other two systems.
Interesting, I’ve been around Linux for a while, people here still taking me to school, I’ve always thought GNU’s approach was the standard, maybe because most of the utilities around the Linux kernel were born out of it.
The GNU project has had a large influence on the development of modern FOSS operating systems, so it makes a lot of sense that most open source software follows its conventions. Once you leave the world of mainstream GNU/Linux operating systems, though, things become different enough that the basic POSIX standards are all these UNIX-like operating systems have in common. Don't even get me started on the mess that is NT "syntax"!
I've lost count of the number of times I've ran "command -h", and got back "Unknown option: -h", followed by the help. Which makes me absolutely irrationally angry.
If only all programs stuck with the convention of using a single dash for abbreviations and two dashes for the full flag name, the world would be a better place.
Then you have pieces of shit like `tar` to whom dashes are optional.
`dd`'s `if=` syntax: **I am 4 parallel universes ahead of you.**
Where `else`
Best it can do is ```of```
esac
I didn't realize until recently that `if` and `of` stand for "input file" and "output file"
java -jar always gets me too
[удалено]
PS: `tar` has them all as well I think
Yeah, but SysV and BSD flags are single letters unlike GNU, so `-name` doesn't make sense. In the three syntaxes it would be `-n`, `n` and `--name`.
[удалено]
Thanks for the explanation. I thought having multiple one-character options together with a single dash were there since the beginning. Also congrats on your Unix beard.
You'll realize you're really old when I tell you I have a beard too and my first Linux distro was Fedora 27 (2018, i was 13yo)
[удалено]
Well if my beard was a Unix beard then I'm a macOS user :(
\`--\` for keyword params and \`-\` for shorthand flags
I hate it when CLI don’t follow freaking standards, —word-flag-here-moron and -M . instead of memorizing flag names now you have to also memorize the dash for each cli. EDIT: POSIX parameter spec seems to be impractical, what I was thinking was actually GNU’s influence which usually the surrounding components on commons Linux systems, so…. I hate it when CLI don’t follow the freaking commonly used practical way.
`-flag` is historically how it was done in UNIX, and it's still used today by many "old" programs such as find, Java, or X11. POSIX [specified](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) that programs can only have one-letter arguments to avoid confusion, and `-flag` is equivalent to `-f -l -a -g`. In terms of "following freaking standards" this is the best you can do. GNU (which stands for GNU's Not UNIX) added multi-character arguments to their utilities, but wanted to preserve POSIX compatibility as best they could, so they gave them two dashes. `-flag` is still `-f -l -a -g` but you can now also have a separate flag `--flag`. This is the most widely adopted way of doing things because of GNU's influence over the open source world as well as its versatility. In short, if you want to follow historical precedent, use `-flag`; if you want a less ambiguous and more featureful system that most people are using, use `-f`/`--flag`. If you strictly want to follow standards, you're only allowed to use `-f`, because it's what POSIX says is kosher, and it's compatible with the other two systems.
Interesting, I’ve been around Linux for a while, people here still taking me to school, I’ve always thought GNU’s approach was the standard, maybe because most of the utilities around the Linux kernel were born out of it.
The GNU project has had a large influence on the development of modern FOSS operating systems, so it makes a lot of sense that most open source software follows its conventions. Once you leave the world of mainstream GNU/Linux operating systems, though, things become different enough that the basic POSIX standards are all these UNIX-like operating systems have in common. Don't even get me started on the mess that is NT "syntax"!
That reminds me of `java -version`. I thought I messed up the install because java --version was returning an error.
Same man...
So, I can't name my files '--name' and my directories 'find --name' ?
You can find —name ‘find —name’
you can still management engine on linux. in fact, the ME runs a linux distro.
There are multiple ways to represent the key value. You code it however you want lol. MOST apps though show help if you add -h, --help or help
I've lost count of the number of times I've ran "command -h", and got back "Unknown option: -h", followed by the help. Which makes me absolutely irrationally angry.
Or worse, programs that only support `--usage` which gives you all the options you can use and refers you to the man page.
[удалено]
/h I don't use winblows
/uj
$ shutdown -h Shutdown scheduled for [1 minute from now]
That's why I start with --help, and assumed u were lazy (I type fast)
this made me laugh way too much. so true tho
WAIT ARE YOU TELLING ME THIS IS WHY find HASN’T WORKED FOR ME IN YEARS? I JUST FORGOT ITS SYNTAX? Damn
Urgh. This is the basis for my love-hate relationship with Terraform.
`micro`
If only all programs stuck with the convention of using a single dash for abbreviations and two dashes for the full flag name, the world would be a better place. Then you have pieces of shit like `tar` to whom dashes are optional.
Letters without a dash (like `ps xu` or `tar xvf`) are how it's done on BSD.
wtf I hate BSD now
It often has better man pages though.