Software Development/Command Line Help

From The Thinkulum
< Software Development
Revision as of 05:48, 22 February 2019 by Andy Culbertson (talk | contribs) (Added the article.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Traditional command-line programs are run from the OS command line, and their help statement is called a usage message. On Unix-like OSes they may also have a man (manual) page. I'll talk about man pages in the "Project documentation" section.

Python has the cmd module for creating a command-line interpreter within your program, and each of your program's commands can also have a help message, contained in the command function's docstring.

My snippets for scripts and command functions will include outlines for usage and help messages.

Usage message

Command help

I haven't found any conventions for cmd help text, and the examples I've seen have been free-form descriptions. Maybe it would make sense to treat each command as a separate program and use usage message conventions for its help.