B0_std_cliCmdliner support for more programs.
The cookbook blueprints has some examples.
module Exit : sig ... endProgram exits.
val path : B0_std.Fpath.t Cmdliner.Arg.convpath is a converter for file system paths. No existence checks are performed on the path. Completes files and directories.
val filepath : B0_std.Fpath.t Cmdliner.Arg.convfilepath is a converter for file paths. No existence checks are performed on the path. Completes files.
val dirpath : B0_std.Fpath.t Cmdliner.Arg.convdirpath is a converter for directory paths. No existence checks are performed on the path. Completes directories.
val cmd : B0_std.Cmd.t Cmdliner.Arg.convcmd is a converter for commands which are parsed using B0_std.Cmd.of_string. Completes files.
no_color ~docs ~env () is a --no-color command line flag.
docs is the manual section in which the option is documented (defaults to Cmdliner.Manpage.s_common_options)env is an environment variable to define the default value. It defaults to no_color_var which is NO_COLOR. The environment variable lookup performed by cmdliner for flags is tweaked to match what is requested by https://no-color.org.val set_no_color :
?docs:Cmdliner.Manpage.section_name ->
?env:Cmdliner.Cmd.Env.info option ->
unit ->
unit Cmdliner.Term.tset_no_color () behaves like no_color and sets B0_std.Fmt.styler to Plain when it's true. See an example.
no_color_var describes the default environment variable NO_COLOR of no_color and set_no_color.
val log_level :
?docs:Cmdliner.Manpage.section_name ->
?absent:B0_std.Log.level ->
?env:Cmdliner.Cmd.Env.info option ->
unit ->
B0_std.Log.level Cmdliner.Term.tlog_level ~docs ~abset ~env () is a command line interface for specifying a log level with these options:
--log-level=LEVEL option to specify the level directly.-v and --verbose flags specify the level as Info (one occurence) or Debug (two occurences).-q and --quiet flags take over all options and specify the level as Quiet.The other arguments are:
docs is the manual section in which the options are documented (defaults to Cmdliner.Manpage.s_common_options)absent is the level when none is specified it defaults to B0_std.Log.level.Warningenv is an environment variable to define the default level value. It defaults to log_level_var which is LOG_LEVEL.val set_log_level :
?docs:Cmdliner.Manpage.section_name ->
?absent:B0_std.Log.level ->
?env:Cmdliner.Cmd.Env.info option ->
unit ->
unit Cmdliner.Term.tset_log_level behaves like log_level and sets the log level. See an example.
log_level_var describes the default environment variable LOG_LEVEL of log_level and set_log_level.
val log_level_conv : B0_std.Log.level Cmdliner.Arg.Conv.tlog_level_conv is a converter for log level.
s_output_format_options is a manual section called "OUTPUT DETAILS OPTIONS"
type output_details = [ | `ShortShort lined-based output with essential details.
*)| `NormalNormal output.
*)| `LongLong output with as much details as possible.
*) ]The type for specifying output level of details.
val output_details : ?docs:string -> unit -> output_details Cmdliner.Term.toutput_details () are mutually exclusive options to specify an output level of detail as `Short, `Normal or `Long.
`Normal.-s or --short specify `Short.-l or --long specify `Long.docs is the manual section in which options are documented, defaults to s_output_details_options.