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 cp -> unit
Adds a cp to the group. Note that the type
'a must be lost to allow cps of different types to belong to the same group.
write filename saves all the cps into the configuration file
method read : ?obsoletes:string -> ?no_default:bool -> ?on_type_error: (groupable_cp -> Raw.cp -> (out_channel -> unit) -> string -> in_channel -> unit) -> string -> unit
read filename reads
filename and 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
filename aren't used.
obsoletes is specified, then prints in this file all the values that are in
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 the cp
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, and
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 read_string : ?obsoletes:string -> ?no_default:bool -> ?on_type_error: (groupable_cp -> Raw.cp -> (out_channel -> unit) -> string -> unit) -> string -> unit
read_string string reads the content of
string and stores the values it specifies into the cps belonging to this group.
This method behaves just like read for the others aspects.
method command_line_args : section_separator:string -> (string * Arg.spec * string) list
Interface with module Arg.