News for hackers. Stuff that matters.
Re:Hints for Writing Unix Tools (2014) by devnull255 on Saturday April 02, 2022 @01:01PM (#30889751)
These are still good guidelines. I would propose some additional guidelines, that as a tool developer myself, will make the tool more accessible and useful.

Provide custom format options, such as --format-json or format--<x> to produce output in JSON or other popular formats.

Implement both short and long options (e.g., -f/--filename) consistent with other command line tools.

Implement a --verbose and/or --debug option to enable more detailed output when needed for troubleshooting.

Provide a --version option to display the tool's version and then exit.

Provide a --help option to display program usage and options and then exit.

Provide useful error messages that at minimum inform the user what went wrong when the program aborted.

As a corollary to the previous guideline, output noisy error output like stack traces, etc. when --verbose is used and an error is encountered.

There are no comments on this comment yet.