package cmdlang-stdlib-runner

  1. Overview
  2. Docs

Module Cmdlang_stdlib_runner.Positional_stateSource

A mutable state that will collect parsing information for positional arguments.

This state is compiled from the AST representation of the command line and is used to collect and store the values of positional arguments during the calls to Arg.anon_fun.

Sourcemodule One_pos : sig ... end
Sourcemodule Pos_all : sig ... end
Sourcetype t = {
  1. pos : One_pos.packed array;
  2. pos_all : Pos_all.packed option;
  3. mutable current_pos : int;
}
Sourceval make : pos:One_pos.packed list -> pos_all:Pos_all.packed option -> t Cmdlang_ast.Ast.or_error_msg
Sourceval anon_fun : t -> Arg.anon_fun

Update the positional state based on the parsing of the next positional argument in the command line.

Usage and help documentation

This section is dedicated to create contents to display for --help messages, such as in:

  Usage: my_command [OPTIONS] [ARGUMENTS]

  ARGUMENTS:
    <arg>  description of arg1
    <arg>  description of arg2
Sourceval usage_msg : t -> string option

Return None if no positional arguments are expected.

OCaml

Innovation. Community. Security.