Parse, print and check values
This module allows to parse values that should match a particular content (URL, list).
The whole module is not exported.
#
parse
| : ctxt:OASISContext.t -> string -> 'a | ; | (* | Parse a string into value | *) |
#
update
| : 'a -> 'a -> 'a | ; | (* | Merge two values into one | *) |
#
print
| : 'a -> string | ; | (* | Convert a value to string | *) |
Definition of a value.
The value exist but there is no easy way to represent it.
It is not possible to combine values.
Same as dot_separated using ',' as separator. Strip whitespaces before and after the input string.
Same dot_separated using '\n' as separator. Strip whitespaces before and after the input string.
with_optional_parentheses v_main v_opt
Combine two values. The input
string "abcd (defg)"
is split between the part not between parentheses
and the one between. v_main
is applied to the first one and v_opt
to
the latter. If no parentheses is found, only apply v_main
.
choices nm lst
Value that must be in a list of predefined choices.
Find the right association in lst
, comparison is case insensitive.
If something failed output a message using nm
as the name of the
value represented.
Arguments of command line programs. See OASISUtils.POSIX.split for more information.