When committing bash crimes..:

πŸ‘Ž set -euo pipefail

πŸ‘ set -o errexit -o nounset -o pipefail

(Give the person reading your script a fighting chance at being able to search the manual for exactly how the heck the cryptic header incantations are influencing shell behaviour in crucial and subtle ways. Greybeards will already know, but it may give a new learner just a bit more of a chance to learn the old magic more easily. Help maintain the front door as well as the foundations and plumbing.)

@gnomon and:

export PS4='${LINENO}: '

@vathpela oho now that's an interesting idea
@gnomon absolute game changer if you've ever found yourself suddenly become the maintainer of a 10000 line shell script that's load bearing for thousands of people...
@vathpela @gnomon If I found myself in that position I'd resign.
@oclsc @gnomon Eh, it wasn't a bad job, and it helped set the stage for fwupd coming into the world. No regrets.

@vathpela @gnomon what I've been using for a while now is PS4='+\e[34m${BASH_SOURCE:--}:\e[1m$LINENO\e[m:${FUNCNAME:+\e[33m$FUNCNAME\e[m} '

becomes useful with things like makepkg that consist of many "library" scripts

@grawity @vathpela sir you appear to have sneezed into your modem, please +++ATH0 and reconnect

@gnomon

While I completely agree with your post, and I often use long form arguments in scripts myself to make them somewhat self-documenting, there's a better way than trying to find anything in the bash man page:

$ help set

@jani sure, or equivalently `set --help` to produce the same output. It's good advice! But if the script reader already knows how to navigate the documentation systems (or even knows that they exist and have a navigable structure and supporting tooling) then they're already through the metaphorical front door.
@gnomon I'd even apply that to longer forms of switches/arguments when using CLI tools in scripts, especially for tools that will take a bunch of them for some specific operations (like, say, curl).
It's not so much about manual pages but since it's not a one-liner you'll copy paste from time to time, it's alright to spare the storage space for --insecure instead of -k to make it even more explicit to anyone reading the script.

@nihl heck yes!

And particularly for curl(1) invocations or other tools where you often end up with five or six or more long options, I'd advocate stashing those options into a bash array before (like _directly_ before) invoking the tool, e.g. https://git.sr.ht/~gnomon/fetch-goo.gl-shortlink-dereferences/tree/main/item/fetch-goo.gl-shortlink-dereferences#L142

Because the array form lets you tuck comments interspersed between the entries to explain what and why each one does, plus it gives you an easy way to comment out specific options while rapid-prototyping.

@gnomon set -u is more of a newbie thing anyway
@mirabilos I understand where you're coming from but my whole point here is about being friendly/friendlier to newbies.
@gnomon Similarly, always use full options rather than short, e.g. `npm install` vs `npm i`, or `curl --header` vs `curl -H`.