Module B00_cli.File_cache

B000.File_cache interaction.

High-level commands.

These commands act on a cache directory. They avoid to create it via B000.File_cache.create if it doesn't exists and return Ok false in that case.

val keys_of_done_ops : B000.Op.t list -> B00_std.String.Set.t

keys_of_done_ops ops are the non-nil hashes of the operations of ops that are B000.Op.status.Done.

val delete : dir:B00_std.Fpath.t -> [ `All | `Keys of B000.File_cache.key list ] -> (bool, string) Stdlib.result

delete dir keys deletes keys in dirs if an explicit key does not exist in dir a Log.warn is issued. If `All is specified dir is deleted and recreated.

val gc : dir:B00_std.Fpath.t -> used:B00_std.String.Set.t -> (bool, string) Stdlib.result

gc ~dir ~used deletes keys that are not in used.

val keys : dir:B00_std.Fpath.t -> (bool, string) Stdlib.result

keys dir lists the file cache keys on stdout.

val stats : dir:B00_std.Fpath.t -> used:B00_std.String.Set.t -> (bool, string) Stdlib.result

status ~dir ~used shows statistics about the file cache on stdout. used determines keys that are in use.

val trim : dir:B00_std.Fpath.t -> used:B00_std.String.Set.t -> max_byte_size:int -> pct:int -> (bool, string) Stdlib.result

trim dir ~used ~max_byte_size ~pct trims the cache using B000.File_cache.trim_size. used determines keys that are assumed to be used.

Cli fragments

val key_arg : B000.File_cache.key Cmdliner.Arg.conv

key_arg is an argument converter for cache keys.

val keys_none_is_all : ?pos_right:int -> unit -> [ `All | `Keys of B000.File_cache.key list ] Cmdliner.Term.t

keys_none_is_all ~pos_right () are the keys at the right of position pos_right (defaults is all positional arguments). If none is specified this is `All.

val trim_cli : ?mb_opts:string list -> ?pct_opts:string list -> ?docs:string -> unit -> (int * int) Cmdliner.Term.t

trim_cli ~docs () are command line options to specify a maximal byte size and percentage to give to trim.