class group :A group of cps, that can be loaded and saved, or used to generate command line arguments.
The basic usage is to have only one group and one configuration file,
but this mechanism allows to have more,
for instance to have another smaller group for the options to pass on the command line.
method add :
'a. 'a cp -> unit
'amust be lost to allow cps of different types to belong to the same group.
cp#get_nameis already used.
method write :
?with_help:bool -> string -> unit
write filenamesaves all the cps into the configuration file
method read :
(Pervasives.out_channel -> unit) ->
string -> Pervasives.in_channel -> unit) ->
string -> unit
filenameand stores the values it specifies into the cps belonging to this group. The file is created (and not read) if it doesn't exists. In the default behaviour, no warning is issued if not all cps are updated or if some values of
obsoletes is specified,
then prints in this file all the values that are
filename but not in this group.
Those cps are likely to be erroneous or obsolete.
Opens this file only if there is something to write in it.
true, then raises
Missing_cp foo if
foo isn't defined in
filename but belongs to this group.
on_type_error groupable_cp value output filename in_channel
is called if the file doesn't give suitable value
(string instead of int for instance, or a string not belonging to the expected enumeration)
for the cp
value is the value read from the file,
output is the argument of
filename is the same argument as the one given to read,
in_channel refers to
filename to allow a function to close it if needed.
Default behaviour is to print an error message and call
method command_line_args :
section_separator:string -> (string * Arg.spec * string) list
section_separator: the string used to concatenate the name of a cp, to get the command line option name.
"-"is a good default.