package oasis

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

Read-write access to 'setup.data'

  • author Sylvain Le Gall
type origin_t =
  1. | ODefault
    (*

    Default computed value.

    *)
  2. | OGetEnv
    (*

    Extracted from environment, using Sys.getenv.

    *)
  3. | OFileLoad
    (*

    From loading file setup.data.

    *)
  4. | OCommandLine
    (*

    Set on command line.

    *)

Origin of the variable, if a variable has been already set with a higher origin, it won't be set again.

type cli_handle_t =
  1. | CLINone
    (*

    No command line argument.

    *)
  2. | CLIAuto
    (*

    Build using variable name and help text.

    *)
  3. | CLIWith
    (*

    Use prefix --with-.

    *)
  4. | CLIEnable
    (*

    Use --enable/--disable.

    *)
  5. | CLIUser of (Arg.key * Arg.spec * Arg.doc) list
    (*

    Fully define the command line arguments.

    *)

Command line handling for variable.

type definition_t = {
  1. hide : bool;
    (*

    Hide the variable.

    *)
  2. dump : bool;
    (*

    Dump the variable.

    *)
  3. cli : cli_handle_t;
    (*

    Command line handling for the variable.

    *)
  4. arg_help : string option;
    (*

    Help about the variable.

    *)
  5. group : OASISTypes.name option;
    (*

    Group of the variable.

    *)
}

Variable type.

Schema for environment.

val env : PropList.Data.t

Data for environment.

val var_expand : string -> string

Expand variable that can be found in string. Variable follow definition of variable for Buffer.add_substitute.

val var_get : OASISTypes.name -> string

Get variable.

val var_choose : ?printer:('a -> string) -> ?name:string -> 'a OASISExpr.choices -> 'a

Choose a value among conditional expressions.

val var_protect : string -> string

Protect a variable content, to avoid expansion.

val var_define : ?hide:bool -> ?dump:bool -> ?short_desc:(unit -> string) -> ?cli:cli_handle_t -> ?arg_help:string -> ?group:string -> OASISTypes.name -> (unit -> string) -> unit -> string

Define a variable.

val var_redefine : ?hide:bool -> ?dump:bool -> ?short_desc:(unit -> string) -> ?cli:cli_handle_t -> ?arg_help:string -> ?group:string -> OASISTypes.name -> (unit -> string) -> unit -> string

Define a variable or redefine it.

val var_ignore : (unit -> string) -> unit

Well-typed ignore for var_define.

val print_hidden : unit -> string

Display all variables, even hidden one.

val var_all : unit -> OASISTypes.name list

Get all variables.

val default_filename : OASISContext.source_filename

Environment default file.

val load : ctxt:OASISContext.t -> ?allow_empty:bool -> ?filename:OASISContext.source_filename -> unit -> unit

Initialize environment.

val unload : unit -> unit

Uninitialize environment.

val dump : ctxt:OASISContext.t -> ?filename:OASISContext.source_filename -> unit -> unit

Save environment on disk.

val print : unit -> unit

Display environment to user.

val args : unit -> (Arg.key * Arg.spec * Arg.doc) list

Default command line arguments, computed using variable definitions.

OCaml

Innovation. Community. Security.