Describing command syntax in messages

This section will show command syntax in usage statements.

  • Show the command syntax in the usage statement. For example, a possible usage statement for the rm command is:
    Usage: rm [-firRe] [--] File ...
  • Capitalize the first letter of such words as File, Directory, String, and Number in usage statement messages.
  • Do not abbreviate parameters on the command line. For example, Num spelled out as Number can be more easily translated.
  • Use only the following delimiters in usage statement messages:
    Delimiter Description
    [] Encloses an optional parameter.
    {} Encloses multiple parameters, one of which is required.
    | Separates parameters that cannot both be chosen. For example, [a|b] indicates that you can choose a, b , or neither a nor b ; and {a|b} indicates that you must choose a or b .
    ... Follows a parameter that can be repeated on the command line. Note that there is a space before the ellipsis.
    - Indicates standard input.
  • Do not use any delimiters for a required parameter that is the only choice. For example:
    banner String
  • Put a space character between flags that must be separated on the command line. For example:
    unget [-n] [-rSID] [-s] {File|-}
  • Do not separate flags that can be used together on the command line. For example:
    wc [-cwl] {File ...|-}
  • Put flags in alphabetic order when the order of the flags on the command line does not make a difference. Put lowercase flags before uppercase flags. For example:
    get -aAijlmM
  • Use your best judgment to determine where you should end lines in the usage statement message. The following example shows a lengthy usage statement message:
    Usage: get [-e|-k] [-c Cutoff] [-i List] [-r SID] [-w String]
     [-x List] [-b] [-gmnpst] ...
    Continue the usage information on a second line, if necessary. For example:
    Usage: get [-e|-k] [-c Cutoff] [-i List] [-r SID] [-w String] 
               [-x List] [-b] [-gmnpst] [-l[p]] File ...