4 ms·
Related to CLI best practices, is there any good styleguide or "best practices" list for formatting help and text output? I've only written a handful of small
by TheAceOfHearts 10y ago
Related to CLI best practices, is there any good styleguide or "best practices" list for formatting help and text output?
I've only written a handful of small CLI utils, and each time I end up looking through tools I regularly use and adapt ideas from each. But this is more time consuming than being able to run through a list of suggestions prepared by someone with more experience in this domain.
- okdana 10y agoPOSIX talks about it a little bit: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_... Some argument-handling libraries like Python's argparse and PHP's Symfony Console generate usage help for you, and they all use a relatively similar formatting that i think was inspired by the formatting of man pages: http://man7.org/linux/man-pages/man7/man-pages.7.html http://man7.org/linux/man-pages/man7/man-pages.7.html docopt (http://docopt.org/ http://docopt.org/) is an attempt to standardise it from the other way around — instead of you defining the options in the code and it generating the usage help for you, you write the usage help and it generates the code to define the options. But i don't know that it's super widely used.
- dredmorbius 10y agohttps://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html https://www.gnu.org/prep/standards/html_node/Command_002dLin... https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/policies.html https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers...