package mopsa

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Command-line options. Replacement for Arg from the standard library

type spec =
  1. | Unit of unit -> unit
  2. | Unit_delayed of unit -> unit
    (*

    Unit_delayed functions are only executed after parsing all the arguments, in the order they appear on the command-line.

    *)
  3. | Unit_exit of unit -> unit
    (*

    As Unit_delayed, but exit immediately after parsing the command-line and executing all the functions (including Unit_exit and Unit_delayed options). Useful for -help.

    *)
  4. | Bool of bool -> unit
  5. | Set of bool Stdlib.ref
  6. | Clear of bool Stdlib.ref
  7. | Int of int -> unit
  8. | Set_int of int Stdlib.ref
  9. | String of string -> unit
  10. | Set_string of string Stdlib.ref
  11. | String_list of string list -> unit
  12. | Set_string_list of string list Stdlib.ref
  13. | Symbol of string list * string -> unit
  14. | Symbol_delayed of string list * string -> unit
  15. | Symbol_exit of string list * string -> unit
type arg = {
  1. key : string;
  2. doc : string;
  3. category : string;
  4. default : string;
  5. spec : spec;
}
val parse : string array -> arg list -> (string -> unit) -> (string list -> unit) -> string -> (unit -> unit) -> unit

Replacement for Arg.parse. Adds delayed Unit arguments.

OCaml

Innovation. Community. Security.