package mirage-runtime

  1. Overview
  2. Docs

Mirage command-line arguments

include module type of Functoria_runtime.Arg

Arg defines command-line arguments which can be set at runtime. This module is the runtime companion of Functoria.Key. It exposes a subset of Cmdliner.Arg.

Runtime command-line arguments

type 'a t

The type for runtime command-line arguments. Similar to Functoria.Key.Arg.t but only available at runtime.

val opt : 'a Cmdliner.Arg.conv -> 'a -> Cmdliner.Arg.info -> 'a t

opt is the runtime companion of Functoria.Ky.Arg.opt.

val opt_all : 'a Cmdliner.Arg.conv -> 'a list -> Cmdliner.Arg.info -> 'a list t

opt_all is the runtime companion of Functoria.Key.Arg.opt_all.

val required : 'a Cmdliner.Arg.conv -> Cmdliner.Arg.info -> 'a t

required is the runtime companion of Functoria.Key.Arg.required.

val key : ?default:'a -> 'a Cmdliner.Arg.conv -> Cmdliner.Arg.info -> 'a t

key is either opt or required, depending if ~default is provided.

val flag : Cmdliner.Arg.info -> bool t

flag is the runtime companion of Functoria.Key.Arg.flag.

val make : (string -> ('a, [ `Msg of string ]) Stdlib.result) -> ('a -> string) -> 'a Cmdliner.Arg.conv

make of_string pp is the command-line argument converter using on of_string and pp.

module type S = sig ... end

S is the signature used by of_module to create a command-line argument converter.

val of_module : (module S with type t = 'a) -> 'a Cmdliner.Arg.conv

of module (module M) creates a command-line argyument converter from a module satisfying the signature S.

Mirage command-line argument converters

val ip_address : Ipaddr.t Cmdliner.Arg.conv

ip converts IP address.

val ipv4_address : Ipaddr.V4.t Cmdliner.Arg.conv

ipv4_address converts an IPv4 address.

val ipv4 : Ipaddr.V4.Prefix.t Cmdliner.Arg.conv

ipv4 converts ipv4/netmask to Ipaddr.V4.t * Ipaddr.V4.Prefix.t .

val ipv6_address : Ipaddr.V6.t Cmdliner.Arg.conv

ipv6_addressconverts IPv6 address.

val ipv6 : Ipaddr.V6.Prefix.t Cmdliner.Arg.conv

ipv6 converts IPv6 prefixes.

val log_threshold : log_threshold Cmdliner.Arg.conv

log_threshold converts log reporter threshold.

val allocation_policy : [ `Next_fit | `First_fit | `Best_fit ] Cmdliner.Arg.conv

allocation_policy converts allocation policy.

OCaml

Innovation. Community. Security.