Previous: Version Output, Up: Command-Line Interfaces


4.6.3 Output of `--help'

There is no parallel node in GNU Standards.

The output of the `--help' option is meant to be a meaningful reminder of the more comprehensive documentation available for any single program. It should be meaningful enough to go beyond a crude list of unexplained option letters. Even long option names are not really helpful when completely bare. It should also be only meant as a clear, concise, yet complete reminder, not trying in any way to replace the comprehensive documentation or make it unnecessary. However, users having already read the manual, or having a good level of familiarity with the program itself, should be usually satisfied with only the `--help' output, for day to day usage.

Some programs necessarily have an extensive `--help' output, because they have really many options, ls and stty come to mind. Others have very few options, like true. Despite these differences, all GNU programs respecting Gnits Standards have similar behaviour. The `--help' output is produced only through an explicit usage of the `--help' option, and is never produced as a side-effect of detecting bad usage, or missing arguments. The proper behaviour for usage errors is producing a possible diagnostic on standard error, followed by a one-line message, still on standard error, saying something like:

     Try `program --help' for more information.

with program replaced by the program name, of course. The diagnostic line preceding the `Try...' line should ideally mention the offending argument. It doesn't matter so much interactively, but when debugging shell scripts, where the arguments might be specified through several layers of variables and nested calls, it can really help pinpoint the culprit (letter from Karl, 1994-09-10).

The `--help' output from various programs should share a similar structure, which may contain the following items, usually in the order given:

Here are some more rules applying to the whole `--help' output:

Here are some rules for the synopsis:

The detailed list of options follow many principles, given here.