Index of values


(%%) [Bos.Cmd]
l %% frag appends the line fragment frag to l.
(%) [Bos.Cmd]
l % arg adds arg to the command line l.
(>>=) [Bos_setup]
(>>=) is R.( >>= ).
(>>|) [Bos_setup]
(>>|) is R.( >>| ).
(^) [Bos_setup]
^ is Astring.(^).

A
add_arg [Bos.Cmd]
add_arg l arg is l % arg.
add_args [Bos.Cmd]
add_args l frag is l %% frag.
array [Bos.OS.Arg]
array ~sep c is like Bos.OS.Arg.list but returns an array instead.

B
bin [Bos.OS.Arg]
bin is Bos.OS.Arg.string mapped by Bos.Cmd.v.
bool [Bos.OS.Arg]
bool converts a boolean with String.to_bool.
bool [Bos.OS.Env]
bool s is a boolean parser.

C
call [Bos.OS.U]
call f v is Ok (f v) but Unix.EINTR errors are catched and handled by retrying the call.
char [Bos.OS.Arg]
char converts a single character.
cmd [Bos.OS.Arg]
cmd converts a non-empty command line with Bos.Cmd.of_string
cmd [Bos.OS.Env]
cmd s is a non-empty command parser using Bos.Cmd.of_string.
compare [Bos.Cmd]
compare l l' is a total order on command lines.
compare [Bos.Pat]
compare p p' is Pervasives.compare p p'.
contents [Bos.OS.Dir]
contents ~dotfiles ~rel dir is the list of directories and files in dir.
conv [Bos.OS.Arg]
conv ~docv parse print is an argument converter parsing values with parse and printing them with print.
conv_docv [Bos.OS.Arg]
conv_printer c is c's documentation meta-variable.
conv_parser [Bos.OS.Arg]
conv_parser c is c's parser.
conv_printer [Bos.OS.Arg]
conv_printer c is c's printer.
create [Bos.OS.Dir]
create ~path ~mode dir creates, if needed, the directory dir with file permission mode (defaults 0o755 readable and traversable by everyone, writeable by the user).
current [Bos.OS.Dir]
current () is the current working directory.
current [Bos.OS.Env]
current () is the current process environment.

D
dash [Bos.OS.File]
dash is Fpath.v "-".
default_tmp [Bos.OS.Dir]
default_tmp () is the directory used as a default value for creating temporary files and directories.
delete [Bos.OS.Dir]
delete ~must_exist ~recurse dir deletes the directory dir.
delete [Bos.OS.File]
delete ~must_exist file deletes file file.
delete [Bos.OS.Path]
delete ~must_exist ~recurse p deletes the path p.
dom [Bos.Pat]
dom p is the set of variables in p.
dump [Bos.Cmd]
dump ppf l dumps and unspecified representation of l on ppf.
dump [Bos.Pat]
dump ppf p prints p as a syntactically valid OCaml string on ppf.

E
empty [Bos.Cmd]
empty is an empty command line.
empty [Bos.Pat]
empty is an empty pattern.
enum [Bos.OS.Arg]
enum l p converts values such that string names in l map to the corresponding value of type 'a.
equal [Bos.Cmd]
equal l l' is true iff l and l' are litterally equal.
equal [Bos.Pat]
equal p p' is p = p'.
err_file [Bos.OS.Cmd]
err_file f is a standard error that writes to file f.
err_null [Bos.OS.Cmd]
err_null is err_file File.null.
err_run_out [Bos.OS.Cmd]
err_run_out is a standard error that is redirected to the run's standard output.
err_stderr [Bos.OS.Cmd]
err_stderr is a standard error that is redirected to the current process standard error.
error_to_msg [Bos.OS.U]
error_to_msg r converts unix errors in r to an error message.
exec [Bos.OS.Arg]
exec is the name of the executable.
exists [Bos.OS.Cmd]
exists cmd is true if the executable of cmd can be found in the path and false otherwise.
exists [Bos.OS.Dir]
exists dir is true if dir is a directory in the file system and false otherwise.
exists [Bos.OS.File]
exists file is true if file is a regular file in the file system and false otherwise.
exists [Bos.OS.Path]
exists p is true if p exists for the file system and false otherwise.

F
flag [Bos.OS.Arg]
flag ~doc ~env names is true if one of the flags in names is present on the command line at most once and false otherwise.
flag_all [Bos.OS.Arg]
flag_all is like Bos.OS.Arg.flag but counts the number of occurences of the flag on the command line.
float [Bos.OS.Arg]
float converts an float with String.to_float.
fold [Bos.OS.Path]
fold err dotfiles elements traverse f acc paths folds over the list of paths paths traversing directories according to traverse (defaults to `Any) and selecting elements to fold over according to elements (defaults to `Any).
fold_contents [Bos.OS.Dir]
contents_fold err dotfiles elements traverse f acc d is:
contents d >>= Path.fold err dotfiles elements traverse f acc
For more details see Bos.OS.Path.fold.
fold_lines [Bos.OS.File]
fold_lines f acc file is like List.fold_left f acc (read_lines p).
format [Bos.Pat]
format ~undef defs p substitutes all variables in p with data.

G
get [Bos.OS.Path.Mode]
get p is p is permission mode.
get_line_exec [Bos.Cmd]
get_line_exec l is like Bos.Cmd.line_exec but

I
in_file [Bos.OS.Cmd]
in_file f is a standard input that reads from file f.
in_null [Bos.OS.Cmd]
in_null is in_file File.null.
in_stdin [Bos.OS.Cmd]
in_stdin is a standard input that reads from the current process standard input.
in_string [Bos.OS.Cmd]
in_string s is a standard input that reads s.
int [Bos.OS.Arg]
int converts an integer with String.to_int.
int32 [Bos.OS.Arg]
int32 converts an int32 with String.to_int32.
int64 [Bos.OS.Arg]
int64 converts an int64 with String.to_int64.
is_empty [Bos.Cmd]
is_empty l is true iff l is empty.

L
line_args [Bos.Cmd]
line_args is l's command line arguments, the elements of l without the command name.
line_exec [Bos.Cmd]
line_exec l is l's first element, usually the executable name.
link [Bos.OS.U]
link is Unix.link, see POSIX link.
link [Bos.OS.Path]
link ~force target p hard links target to p.
list [Bos.OS.Arg]
list ~sep c converts a list of c.
log_fold_error [Bos.OS.Path]
log_fold_error level is a Bos.OS.Path.fold_error function that logs error with level level and always returns `Ok ().
lstat [Bos.OS.U]
lstat is Unix.lstat, see POSIX lstat.

M
matches [Bos.OS.Path]
matches ~dotfiles pat is the list of paths in the file system that match the path pattern pat.
matches [Bos.Pat]
matches p s is true iff the string s matches p.
mkdir [Bos.OS.U]
mkdir is Unix.mkdir, see POSIX mkdir.
move [Bos.OS.Path]
move ~force src dst moves path src to dst.
must_exist [Bos.OS.Cmd]
must_exist cmd is Ok cmd if Bos.OS.Cmd.exists is true and an error otherwise.
must_exist [Bos.OS.Dir]
must_exist dir is Ok dir if dir is a directory in the file system and an error otherwise.
must_exist [Bos.OS.File]
must_exist file is Ok file if file is a regular file in the file system and an error otherwise.
must_exist [Bos.OS.Path]
must_exist p is Ok p if p exists for the file system and an error otherwise.

N
nativeint [Bos.OS.Arg]
int converts a nativeint with String.to_nativeint.
null [Bos.OS.File]
null is Fpath.v "/dev/null" on POSIX and Fpath.v "NUL" on Windows.

O
of_list [Bos.Cmd]
of_list ?slip l is a command line from the list of arguments l.
of_string [Bos.Cmd]
of_string s tokenizes s into a command line.
of_string [Bos.Pat]
of_string s parses s according to the pattern syntax (i.e.
of_values [Bos.Cmd]
of_values ?slip conv l is like Bos.Cmd.of_list but acts on a list of values, each converted to an argument with conv.
on [Bos.Cmd]
on bool line is line if bool is true and Bos.Cmd.empty otherwise.
open_error [Bos.OS.U]
open_error r allows to combine a closed unix error variant with other variants.
opt [Bos.OS.Arg]
opt ~docv ~doc ~env names c ~absent is a value defined by the value of an optional argument that may appear at most once on the command line under one of the names specified by names.
opt_all [Bos.OS.Arg]
opt_all is like Bos.OS.Arg.opt but the optional argument can be repeated.
opt_var [Bos.OS.Env]
opt_var name absent is the value of the optionally defined environment variable name if defined and absent if undefined.
out_file [Bos.OS.Cmd]
out_file f o writes the standard output o to file f.
out_lines [Bos.OS.Cmd]
out_lines is like Bos.OS.Cmd.out_string but the result is splitted on newlines ('\n').
out_null [Bos.OS.Cmd]
out_null o is out_file File.null o.
out_run_in [Bos.OS.Cmd]
out_run_in o is a run input that can be used to feed the standard output of o to the standard input of another, single, command run.
out_stdout [Bos.OS.Cmd]
to_stdout o redirects the standard output o to the current process standard output.
out_string [Bos.OS.Cmd]
out_string ~trim o captures the standard output o as a string.

P
p [Bos.Cmd]
p is Fpath.to_string.
pair [Bos.OS.Arg]
pair ~sep fst snd converts a pair of fst and snd.
parse [Bos.OS.Arg]
parse ~pos is like Bos.OS.Arg.parse_opts but returns and converts the positional arguments with pos rather than error on them.
parse [Bos.OS.Env]
parse name p ~absent is: Ok absent if Env.var name = None, Ok v if Env.var name = Some s and p s = Ok v, Error (`Msg m) otherwise with m an error message that mentions name and the parse error of p.
parse_opts [Bos.OS.Arg]
parse_opts () can: Return () if no command line error occured and -help or --help was not specified., Never return and exit the program with 0 after having printed the help on stdout., Never return and exit the program with 1 after having printed an error on stderr if a parsing error occured.
parser [Bos.OS.Env]
parser kind k_of_string is an environment variable value from the k_of_string function.
parser_of_kind_of_string [Bos.OS.Arg]
parser_of_kind_of_string ~kind kind_of_string is an argument parser using the kind_of_string function for parsing and kind for errors (e.g.
path [Bos.OS.Arg]
path converts a path argument using Fpath.of_string.
path [Bos.OS.Env]
path s is a path parser using Fpath.of_string.
pp [Bos.Cmd]
pp ppf l formats an unspecified representation of l on ppf.
pp [Bos.Pat]
pp ppf p prints p on ppf according to the pattern syntax.
pp_error [Bos.OS.U]
pp_error ppf e prints e on ppf.
pp_status [Bos.OS.Cmd]
pp_status is a formatter for statuses.

Q
query [Bos.OS.Path]
query ~init pat is like Bos.OS.Path.matches except each matching path is returned with an environment mapping pattern variables to their matched part in the path.
query [Bos.Pat]
query ~init p s is like Bos.Pat.matches except that a matching string returns a map from each pattern variable to its matched part in the string (mappings are added to init, defaults to String.Map.empty) or None if s doesn't match p.

R
read [Bos.OS.File]
read file is file's content as a string.
read_lines [Bos.OS.File]
read_lines file is file's content, split at each '\n' character.
rename [Bos.OS.U]
rename is Unix.rename, see POSIX rename.
req_var [Bos.OS.Env]
req_var name is the value of the environment variable name or an error if name is undefined in the environment.
run [Bos.OS.Cmd]
run ?env ?err cmd is (in_stdin |> run_io ?env ?err cmd |> to_stdout).
run_in [Bos.OS.Cmd]
run_in ?env ?err cmd i is (run_io ?env ?err cmd |> to_stdout).
run_info_cmd [Bos.OS.Cmd]
run_info_cmd ri is the command that was run.
run_io [Bos.OS.Cmd]
run_io ~env ~err cmd i represents the standard output of the command run cmd performed in process environment env with its standard error output handled according to err (defaults to Bos.OS.Cmd.err_stderr) and standard input connected to i.
run_out [Bos.OS.Cmd]
run_out ?env ?err cmd is (in_stdin |> run_io ?env ?err cmd).
run_status [Bos.OS.Cmd]
run_status ?env ?err ?quiet cmd is (in_stdin |> run_io ?env ?err ?cmd |> out_stdout) and extracts the run status.

S
set [Bos.OS.Path.Mode]
set p m sets p's permission mode to m.
set_current [Bos.OS.Dir]
set_current dir sets the current working directory to dir.
set_default_tmp [Bos.OS.Dir]
set_default_tmp p sets the value returned by Bos.OS.Dir.default_tmp to p.
set_var [Bos.OS.Env]
set_var name v sets the environment variable name to v.
some [Bos.OS.Arg]
some none c is like the converter c but wraps its result in Some.
some [Bos.OS.Env]
some p is wraps p's parse result in Some.
stat [Bos.OS.U]
stat is Unix.stat, see POSIX stat.
stat [Bos.OS.Path]
stat p is p's file information.
strf [Bos_setup]
strf is Astring.strf.
string [Bos.OS.Arg]
string converts a string argument.
string [Bos.OS.Env]
string s is a string parser, it always succeeds.
subst [Bos.Pat]
subst ~undef defs p tries to substitute variables in p by their value.
success [Bos.OS.Cmd]
success r is: Ok v if r = Ok (v, (_, `Exited 0)), Error _ otherwise. Non `Exited 0 statuses are turned into an error message.
symlink [Bos.OS.Path]
symlink ~force target p symbolically links target to dst.
symlink_stat [Bos.OS.Path]
symlink_stat p is the same as Bos.OS.Path.stat but if p is a link returns information about the link itself.
symlink_target [Bos.OS.Path]
slink_target p is p's target iff p is a symbolic link.

T
tmp [Bos.OS.Dir]
tmp mode dir pat is a new empty directory in dir (defaults to Bos.OS.Dir.default_tmp) named according to pat and created with permissions mode (defaults to 0o700 only readable and writable by the user).
tmp [Bos.OS.File]
tmp mode dir pat is a new empty temporary file in dir (defaults to Bos.OS.Dir.default_tmp) named according to pat and created with permissions mode (defaults to 0o600 only readable and writable by the user).
to_file [Bos.OS.Cmd]
to_file ?append f o is (out_file ?append f o |> success).
to_lines [Bos.OS.Cmd]
to_lines ~trim o is (out_lines ~trim o |> success).
to_list [Bos.Cmd]
to_list l is l as a list of strings.
to_null [Bos.OS.Cmd]
to_null o is to_file File.null o.
to_stdout [Bos.OS.Cmd]
to_stdout o is (out_stdout o |> success).
to_string [Bos.OS.Cmd]
to_string ~trim o is (out_string ~trim o |> success).
to_string [Bos.Cmd]
to_string l converts l to a string that can be passed to the command(3) POSIX system call.
to_string [Bos.Pat]
to_string p converts p to a string according to the pattern syntax (i.e.
truncate [Bos.OS.U]
truncate is Unix.truncate, see POSIX truncate.
truncate [Bos.OS.File]
truncate p size truncates p to s.

U
unlink [Bos.OS.U]
stat is Unix.unlink, POSIX unlink.
user [Bos.OS.Dir]
user () is the home directory of the user executing the process.

V
v [Bos.Cmd]
v cmd is a new command line (or command line fragment) whose first argument is cmd.
v [Bos.Pat]
v s is a pattern from the string s.
value [Bos.OS.Env]
value ~log name p ~absent is like Bos.OS.Env.parse but in case of error the message is logged with level log (defaults to Logs.Error) and ~absent is returned.
var [Bos.OS.Env]
var name is the value of the environment variable name, if defined.

W
with_current [Bos.OS.Dir]
with_current dir f v is f v with the current working directory bound to dir.
with_ic [Bos.OS.File]
with_ic file f v opens file as a channel ic and returns Ok (f ic v).
with_input [Bos.OS.File]
with_input file f v provides contents of file with an input i and returns f i v.
with_oc [Bos.OS.File]
with_oc file f v opens file as a channel oc and returns Ok (f oc v).
with_output [Bos.OS.File]
with_output file f v writes the contents of file using an output o given to f and returns Ok (f o v).
with_tmp [Bos.OS.Dir]
with_tmp mode dir pat f v is a new empty directory in dir (defaults to Bos.OS.Dir.default_tmp) named according to pat and created with permissions mode (defaults to 0o700 only readable and writable by the user).
with_tmp_oc [Bos.OS.File]
with_tmp_oc mode dir pat f v is a new temporary file in dir (defaults to Bos.OS.Dir.default_tmp) named according to pat and atomically created and opened with permission mode (defaults to 0o600 only readable and writable by the user).
with_tmp_output [Bos.OS.File]
with_tmp_output dir pat f v is a new temporary file in dir (defaults to Bos.OS.Dir.default_tmp) named according to pat and atomically created and opened with permissions mode (defaults to 0o600 only readable and writable by the user).
write [Bos.OS.File]
write file content outputs content to file.
write_lines [Bos.OS.File]
write_lines file lines is like write file (String.concat ~sep:"\n" lines).
writef [Bos.OS.File]
write file fmt ... is like write file (Format.asprintf fmt ...).