package mirage

  1. Overview
  2. Docs
The MirageOS library operating system

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mirage-4.0.0.tbz
sha256=f804161872de6cf20699364f09d03370ed06aafffb12f1d586190832c73a194d
sha512=75c1c1cac4c6f862c0055381c7ced123785193234b40da8a8e238cb289cba1a4494378587c4edf2ed872aee7fbfc756f84087941c1037ac19cbd1733ff6cca6a

doc/mirage.key/Mirage_key/Arg/index.html

Module Mirage_key.ArgSource

include module type of struct include Functoria.Key.Arg end

Argument converters

Sourcetype 'a serialize = Format.formatter -> 'a -> unit

The type for command-line argument serializers. A value of type 'a serialize generates a syntactically valid OCaml representation which evaluates to a value of type 'a.

Sourcetype 'a runtime_conv = string

The type for command-line argument converters used at runtime. A value of type 'a runtime_conv is a symbol name of type Cmdliner.Arg.converter.

Sourcetype 'a converter = 'a Functoria.Key.Arg.converter

The type for argument converters.

Sourceval conv : conv:'a Cmdliner.Arg.conv -> serialize:'a serialize -> runtime_conv:'a runtime_conv -> 'a converter

conv c s r is the argument converter using c to convert user strings into OCaml value, s to convert OCaml values into strings interpretable as OCaml expressions, and the function named r to convert user strings into OCaml values at runtime.

Sourceval string : string converter

string converts strings.

Sourceval bool : bool converter

bool converts booleans.

Sourceval int : int converter

int converts integers.

Sourceval int64 : int64 converter

int64 converts 64-bits integers.

Sourceval list : 'a converter -> 'a list converter

list t converts lists of ts.

Sourceval some : 'a converter -> 'a option converter

some t converts t options.

Arguments and their information

The type for arguments holding data of type 'a.

The type for information about cross-stage command-line arguments. See Cmdliner's arguments.

Sourceval info : ?docs:string -> ?docv:string -> ?doc:string -> ?env:string -> string list -> info

Define cross-stage information for an argument. See Cmdliner.Arg.info. If not set, docs is "UNIKERNEL PARAMETERS".

Optional Arguments

Sourcetype stage = [
  1. | `Configure
  2. | `Run
  3. | `Both
]

The type for specifying at which stage an argument is available.

  • `Configure means that the argument is read on the command-line at configuration-time.
  • `Run means that the argument is read on the command-line at runtime.
  • `Both means that the argument is read on the command-line both at configuration-time and run-time.
Sourceval opt : ?stage:stage -> 'a converter -> 'a -> info -> 'a t

opt conv v i is similar to Cmdliner.Arg.opt but for cross-stage optional command-line arguments. If not set, stage is `Both.

Sourceval required : ?stage:stage -> 'a converter -> info -> 'a option t

required conv i is similar to Cmdliner.Arg.required but for cross-stage required command-line arguments. If not set, stage is `Both.

Sourceval flag : ?stage:stage -> info -> bool t

flag i is similar to Cmdliner.Arg.flag but for cross-stage command-line flags. If not set, stage is `Both.

Sourceval opt_all : ?stage:stage -> 'a converter -> info -> 'a list t
Sourceval ipv4_address : Ipaddr.V4.t converter
Sourceval ipv6_address : Ipaddr.V6.t converter
Sourceval ip_address : Ipaddr.t converter