Module Core__Core_command.Anons

Anonymous command-line argument specification.

type +'a t
val (%:) : Core_kernel__.Import.string -> 'a Arg_type.t -> 'a t

(name %: typ) specifies a required anonymous argument of type typ.

The name must not be surrounded by whitespace; if it is, an exn will be raised.

If the name is surrounded by a special character pair (<>, {}, [] or (),) name will remain as-is, otherwise, name will be uppercased.

In the situation where name is only prefixed or only suffixed by one of the special character pairs, or different pairs are used (e.g., "<ARG]"), an exn will be raised.

The (possibly transformed) name is mentioned in the generated help for the command.

val sequence : 'a t -> 'a Core_kernel__.Import.list t

sequence anons specifies a sequence of anonymous arguments. An exception will be raised if anons matches anything other than a fixed number of anonymous arguments.

val non_empty_sequence_as_pair : 'a t -> ('a * 'a Core_kernel__.Import.list) t

non_empty_sequence_as_pair anons and non_empty_sequence_as_list anons are like sequence anons except that an exception will be raised if there is not at least one anonymous argument given.

val non_empty_sequence_as_list : 'a t -> 'a Core_kernel__.Import.list t
val maybe : 'a t -> 'a Core_kernel__.Import.option t

(maybe anons) indicates that some anonymous arguments are optional.

val maybe_with_default : 'a -> 'a t -> 'a t

(maybe_with_default default anons) indicates an optional anonymous argument with a default value.

val t2 : 'a t -> 'b t -> ('a * 'b) t
val t3 : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) t
val t4 : 'a t -> 'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) t
val map_anons : 'a t -> f:('a -> 'b) -> 'b t

map_anons anons ~f transforms the parsed result of anons by applying f.