[Home] Module Microsoft.FSharp.Compatibility.OCaml.Arg


A simple command-line argument processor.

Type Definitions

TypeDescription
type argspec Note: an abbreviation for string * spec * string
type spec The spec value describes the action of the argument, and whether it expects a following parameter.

Exceptions

ExceptionDescription
exception Bad
exception Help

Values

ValueDescription
val parse : argspec list -> (string -> unit) -> string -> unit
"parse specs f use" parses the arguments given by Sys.argv according to the argument processing specifications "specs". Arguments begin with "-". Non-arguments are passed to "f" in order. "use" is printed as part of the usage line if an error occurs. Permitted arguments are specified using triples: (arg, action, help). Actions are: Unit(f): call f, no subseq. arg Set(br): set ref to 'true', no subseq. arg. Clear(br): set ref to 'false, no subseq. arg. String(f): pass the subseq. arg to f Int(f): pass the subseq. arg to f Float(f): pass the subseq. arg to f Rest(f): pass all subseq. args to f in order
val parse_argv :
  int ref -> string array -> argspec list -> (string -> unit) -> string -> unit
val usage : argspec list -> string -> unit
"usage specs use" prints the help for each argument.

See Also

Microsoft.FSharp.Compatibility.OCaml


Documentation for assembly FSharp.Compatibility, version 1.9.4.19, generated using F# version 1.9.4.19