package batteries
Install
Dune Dependency
Authors
Maintainers
Sources
md5=1fd7bddce07cf5d244fc9427f7b5e4d4
sha512=c0f2a0fdc8253e0ea999d8d4c58bfbf32b18d251a2e1d9656bf279de5f01a33e9aabac3af4d95f465f8b671e7711ebd37218043face233340a0c11b08fa62f78
doc/batteries.unthreaded/BatOptParse/StdOpt/index.html
Module BatOptParse.StdOpt
Source
This module contains various standard options.
Flag options
store_const ?default const
returns a flag option which stores the constant value const
when the option is encountered on the command line.
store_true ()
returns an option which is set to true when it is encountered on the command line. The default value is false.
store_false ()
returns an option which is set to false when it is encountered on the command line. The default value is true.
Create a counting option which increments its value each time the option is encountered on the command line.
Exactly identical to count_option ~dest:dest ~increment:1 ()
.
Exactly identical to count_option ~dest:dest ~increment:(-1) ()
.
Value options
int_option ?default ?metavar ()
returns an option which takes a single integer argument. If ~default
is given it is the default value returned when the option has not been encountered on the command line.
See OptParse.StdOpt.int_option
.
See OptParse.StdOpt.int_option
.
any_option ?default ?metavar coerce
returns an option which takes a single argument from the command line and calls coerce
to coerce it to the proper type.
default
is the default value of the option. If None
, the option has no default value.
Callback options
int_callback ?metavar f
returns an option which takes a single integer argument and calls f
with that argument when encountered on the command line.
See OptParse.StdOpt.int_callback
.
See OptParse.StdOpt.int_callback
.
Special options
help_option ()
returns the standard help option which displays a usage message and exits the program when encountered on the command line.