Writing Consistent Tools (2019)

5 points by mt


Qyriad

Most of these are pretty straightforward (and I would argue usually good), but the password handling one is surprisingly comprehensive for something Unix-philosophy-aligned — including support for not just arbitrary commands, but also the system keyring and two specific password managers! Not that I think that’s a bad thing, but I can certainly see why they packaged it into the getpass Go library, while everything else is pretty reasonable to just hand-write every tool you make.

Well, okay, that and printing current status upon SIGINFO. That could be anywhere from trivial to nightmarishly complex depending on what you’re writing.

koala

According to signal(7) (GNU, I guess), SIGINFO is an alias for SIGPWR, which is "Power failure (System V)". Is there a fun story there?

dd reacts to SIGUSR1 for providing progress information. I think there's no standard convention. I was surprised that (according to the article), shells provide a key for SIGINFO/SIGPWR. Maybe I'm missing obvious things?