Module Topkg.Cmd

module Cmd: sig .. end
Command lines.

Both command lines and command line fragments using the same are represented with the same type.

When a command line is run, the first element of the line defines the program name and each other element is an argument that is passed as is in the program's argv array: no shell interpretation or any form of argument quoting and/or concatenation occurs.



Command line fragments


type t 
The type for command line fragments.
val v : string -> t
v cmd is a new command line (or command line fragment) whose first argument is cmd.
val empty : t
empty is an empty command line.
val is_empty : t -> bool
is_empty l is true iff l is empty.
val (%) : t -> string -> t
l % arg adds arg to the command line l.
val (%%) : t -> t -> t
l %% frag appends the line fragment frag to l.
val add_arg : t -> string -> t
add_arg l arg is l % arg.
val add_args : t -> t -> t
add_args l frag is l %% frag.
val on : bool -> t -> t
on bool line is line if bool is true and Topkg.Cmd.empty otherwise.
val p : Topkg.fpath -> string
p is (fun f -> f).

Predicates and comparison


val equal : t -> t -> bool
equal l l' is true iff l and l' are litterally equal.
val compare : t -> t -> int
compare l l' is a total order on command lines.

Conversions and pretty printing


val to_list : t -> string list
to_list l is l as a list of strings.
val of_list : ?slip:string -> string list -> t
of_list ?slip l is a command line from the list of arguments l. If slip is specified it is added on the command line before each element of l.
val dump : Format.formatter -> t -> unit
dump ppf cmd formats an unspecified representation of cmd on ppf.