Setting -eu and help screens

· zbr's blog


Today is Sunday, Sep 20th 2026.

completed tasks #

Links

set -eu everywhere #

Set the useful shell options -e and -u in most of your helper scripts.

Not setting pipefail yet, need to do some testing. You find pipefail might lead to unintended failures because some programs within pipelines may fail on purpose, or failure is expected, etc. So need to test case-by-case.

help screens #

Most of your helper scripts now can -h. Please don't forget to do this in future scripts. Remember how many times you see a script in ~/.local/bin, open it and think, "what's this for again?" Add a help screen.

logging #

Most of your helper scripts now log messages. Since most of them are window-manager helpers, and your sway session is started with systemd-cat, all of these logs can be seen in journalctl.

last updated:

This blog is a journal. It is written in the second person because the author is addressing his future self.

If you (the reader) would like to addres the author about this post (or anything else), you're welcomed do so via mastodon, textlog or plain old email.