Module Cmdliner.Cmd.Exit

module Exit: sig .. end

Exit codes and their information.


Exit codes

type code = int 

The type for exit codes.

Warning. You should avoid status codes strictly greater than 125 as those may be used by some shells.

val ok : code

ok is 0, the exit status for success.

val some_error : code

some_error is 123, an exit status for indisciminate errors reported on stderr.

val cli_error : code

cli_error is 124, an exit status for command line parsing errors.

val internal_error : code

internal_error is 125, an exit status for unexpected internal errors.

Exit code information

type info 

The type for exit code information.

val info : ?docs:string ->
?doc:string ->
?max:code ->
code -> info

exit_info ~docs ~doc min ~max describe the range of exit statuses from min to max (defaults to min). doc is the man page information for the statuses, defaults to "undocumented". docs is the title of the man page section in which the statuses will be listed, it defaults to Cmdliner.Manpage.s_exit_status.

In doc the documentation markup language can be used with following variables:

val info_code : info -> code

info_code i is the minimal code of i.

val defaults : info list

defaults are exit code information for Cmdliner.Cmd.Exit.ok, Cmdliner.Cmd.Exit.some_error Cmdliner.Cmd.Exit.cli_error and Cmdliner.Cmd.Exit.internal_error.