Tool man pages
Man page sections for a command are printed in the order specified by manual as given to
Cmdliner.Cmd.info. Unless specified explicitely in the command's manual the following sections are automaticaly created and populated for you:
doc documentation strings specified by the command's term arguments get inserted at the end of the documentation section they respectively mention in their
- For commands, see
- For positional arguments, see
Cmdliner.Arg.info. Those are listed iff both the
docstring is specified by
- For optional arguments, see
- For exit statuses, see
- For environment variables, see
docs section name is mentioned and does not exist in the command's manual, an empty section is created for it, after which the
doc strings are inserted, possibly prefixed by boilerplate text (e.g. for
If the created section is:
- standard, it is inserted at the right place in the order specified here, but after a possible non-standard section explicitely specified by the command's manual since the latter get the order number of the last previously specified standard section or the order of
Cmdliner.Manpage.s_synopsisif there is no such section.
- non-standard, it is inserted before the
Cmdliner.Manpage.s_commandssection or the first subsequent existing standard section if it doesn't exist. Taking advantage of this behaviour is discouraged, you should declare manually your non standard section in the command's manual page.
Finally note that the header of empty sections are dropped from the output. This allows you to share section placements among many commands and render them only if something actually gets inserted in it.
Documentation markup language
Manpage blocks and doc strings support the following markup language.
- Markup directives
textis raw text respectively rendered in italics and bold.
- Outside markup directives, context dependent variables of the form
$(var)are substituted by marked up data. For example in a term's man page
$(tname)is substituted by the term name in bold.
- Characters $, (, ) and \ can respectively be escaped by \$, \(, \) and \\ (in OCaml strings this will be
"\\\\"). Escaping $ and \ is mandatory everywhere. Escaping ) is mandatory only in markup directives. Escaping ( is only here for your symmetric pleasure. Any other sequence of characters starting with a \ is an illegal character sequence.
- Refering to unknown markup directives or variables will generate errors on standard error during documentation generation.