Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Bos.Cmd
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 will be passed as is in the program's argv array: no shell interpretation or any form of argument quoting and/or concatenation occurs.
of_string s tokenizes s into a command line. The tokens are recognized according to the token production of the following grammar which should be mostly be compatible with POSIX shell tokenization.
qchar are substitued by the byte they escape except for '\n' which removes the backslash and newline from the byte stream. squoted and dquoted represent the bytes they enclose.
dump ppf l dumps and unspecified representation of l on ppf.
Examples
let ls path = Cmd.(v "ls" % "-a" % p path)
let tar archive path = Cmd.(v "tar" % "-cvf" % p archive % p path)
let opam cmd = Cmd.(v "opam" % cmd)
let opam_install pkgs = Cmd.(opam "install" %% of_list pkgs)
let ocamlc ?(debug = false) file =
Cmd.(v "ocamlc" % "-c" %% on debug (v "-g") % p file)
let ocamlopt ?(profile = false) ?(debug = false) incs file =
let profile = Cmd.(on profile @@ v "-p") in
let debug = Cmd.(on debug @@ v "-g") in
let incs = Cmd.of_list ~slip:"-I" incs in
Cmd.(v "ocamlopt" % "-c" %% debug %% profile %% incs % p file)