Often, command line parameters are documented using a vaguely EBNF-ish notation such as the following:
The output of
dir /?on Windows:
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
The output of
netsh /?on Windows:
Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password | *] [Command | -f ScriptFile]
expand [-r] source [destination] [-dsource.cab [-f:files]] [source.cab [-f:filesdestination] [-i]
date [OPTION]... [+FORMAT] date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
compress [ -f ] [ -v ] [ -c ] [ -V ] [ -r ] [ -b bits ] [ name ... ]
These notations all have similar formats:
used to indicate optional parameters.
|used to separate exclusive choices.
...used to mean that the preceding thing occurs multiple times (
[x...]are the same form of this).
- Not shown in examples:
()for grouping, especially when non-optional parameters and a
My question is: I've always just taken it as a given that command line parameters are documented this way. It's easy to understand because it's pretty much ubiquitous, and when I document them myself I just naturally do it this way. However, does this notation have a name?
For example, if I were to write some documentation guidelines that said "all command line parameters must be documented in _______ format" or something along those lines, what would I say?