type spec = String of (string -> unit) | Int of (int -> unit) | Unit of (unit -> unit) | Float of (float -> unit)
The concrete type describing the behavior associated with a keyword.
value parse : (string * spec) list -> (string -> unit) -> unit
parse speclist anonfun parses the command line, calling the functions in speclist whenever appropriate, and anonfun on anonymous arguments. The functions are called in the same order as they appear on the command line. The strings in the (string * spec) list are keywords and must start with a -, else they are ignored. For the user to be able to specify anonymous arguments starting with a -, include for example ("--", String anonfun) in speclist.
exception Bad of string
Functions in speclist or anonfun can raise Bad with an error message to reject invalid arguments.