[Cialug] The Complete CLI Command, According to This Guy
Todd Walton
tdwalton at gmail.com
Tue Oct 9 19:53:40 UTC 2018
12 Factor CLI Apps
https://hn.premii.com/#/article/18172689
Guy says all (not all, but all enough) CLI apps should have a certain set
of features:
* good online help system, but skip man pages
* flags -- don't use bare arguments
* version -- report version with --version
* discriminates streams, sending output to stdout, messages to stderr
* informative, verbose, error messages
* uses tty features: spinners, progress bars, color
* interactively prompts for values when missing, instead of just returning
* tables for structured data output -- bonus: csv or json output
* good performance -- just calling the command should return in 100ms–500ms
* be open source
* good subcommands (think git add, git checkout, etc)
* use freedesktop specs -- use ~/.config, for example
I mostly agree. If all command line programs met at least half of these
we'd be way better off. But the whole thing seems kind of sloppy, and I
think he stretched a bit just to meet the magic number "12" for the number
of features. I definitely do *not* agree with skipping man pages. It drives
me nutty when a command line program of any complexity at all fails to have
man pages. It tells me that the author of the program doesn't know Unix
conventions or doesn't care enough to finish the job, and so I'm going to
have to use extra caution when running the program lest it do something
unexpected and un-Unixy and screw things up.
--
Todd
More information about the Cialug
mailing list