Comment by saghm
7 hours ago
I'd argue that short options aren't particularly more likely to be portable. Years ago I was debugging a CI issue that turned out to be caused by a script hard-coding the short option for base64 decoding, which was not compatible across the GNU and BSD versions (one of them used -d and the other used -D, I can't remember which was which, and that's basically the same issue honestly). I was trying to figure out if I needed to check MacOS versus Linux (I think I was fixing the newly-added MacOS job at the time) when I realized that they both used --decode as the long option, which meant that the long option being used originally would have prevented the issue in the first place.
That reminds me of a really horrible afternoon in pre-gpt devops when I learned to add
```bash
if [[ $OSTYPE == “darwin” ]]; then
fi
Assuming you have run `brew install gnutools` on your Mac that should enable local dev for scripts that run on Linux. Apple’s bsd sed fork is strange.
Not all short options are portable, but all POSIX options are short.
I guess my point is that I don't really care what the standard says if it doesn't cover enough of what I'm doing, and in practice, I can't recall a single time where I had a script that was incompatible with where I ran it because of a long option where a short one would have been compatible.