Documenting a Command Suite
Since command suites like todo are more complex than simpler
command-line apps like db_backup.rb, it’s important that we have
documentation and that it’s easy to access. Users need to know not only what each option
does and what the arguments mean but also what commands are available and what they do.
The best way to provide this information is via a two-level help system.
At the top “level,” we see the “banner”-type information, the global options,
the list of commands, and what each command does. This information should be provided
when the app is invoked with no arguments or when invoked with the command
help, like so:
| | $ bin/todo help |
| | NAME |
| | todo - |
| | |
| | SYNOPSIS |
| | todo [global options] command [command ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access