sig
type 'a result = [ `Error of string | `Ok of 'a ]
val ret : 'a -> 'a As_cmd.result
val error : string -> 'a As_cmd.result
val bind : 'a As_cmd.result -> ('a -> 'b As_cmd.result) -> 'b As_cmd.result
val map : 'a As_cmd.result -> ('a -> 'b) -> 'b As_cmd.result
val get : 'a As_cmd.result -> 'a
val on_error : ?level:As_log.level -> use:'a -> 'a As_cmd.result -> 'a
val ignore_error : use:'a -> 'a As_cmd.result -> 'a
val reword_error :
?replace:bool -> string -> 'a As_cmd.result -> 'a As_cmd.result
val exn_error :
?msg:(Printexc.raw_backtrace -> exn -> 'a -> string) ->
('a -> 'b) -> 'a -> 'b As_cmd.result
val ( >>= ) :
'a As_cmd.result -> ('a -> 'b As_cmd.result) -> 'b As_cmd.result
val ( >>| ) : 'a As_cmd.result -> ('a -> 'b) -> 'b As_cmd.result
module Infix :
sig
val ( >>= ) :
'a As_cmd.result -> ('a -> 'b As_cmd.result) -> 'b As_cmd.result
val ( >>| ) : 'a As_cmd.result -> ('a -> 'b) -> 'b As_cmd.result
end
type path = As_path.t
module Path :
sig
val exists : As_path.t -> bool As_cmd.result
val move : ?force:bool -> As_path.t -> As_path.t -> unit As_cmd.result
end
module File :
sig
val dev_null : As_path.t
val exists : As_path.t -> bool As_cmd.result
val delete : ?maybe:bool -> As_path.t -> unit As_cmd.result
val temp : string -> As_path.t As_cmd.result
val with_inf :
(Pervasives.in_channel -> 'a -> 'b As_cmd.result) ->
As_path.t -> 'a -> 'b As_cmd.result
val read : As_path.t -> string As_cmd.result
val read_lines : As_path.t -> string list As_cmd.result
val with_outf :
(Pervasives.out_channel -> 'a -> 'b As_cmd.result) ->
As_path.t -> 'a -> 'b As_cmd.result
val write : As_path.t -> string -> unit As_cmd.result
val write_lines : As_path.t -> string list -> unit As_cmd.result
val write_subst :
(string * string) list -> As_path.t -> string -> unit As_cmd.result
end
module Dir :
sig
val exists : As_path.t -> bool As_cmd.result
val getcwd : unit -> As_path.t As_cmd.result
val chdir : As_path.t -> unit As_cmd.result
val fold_files_rec :
?skip:string list ->
(string -> 'a -> 'a As_cmd.result) ->
'a -> string list -> 'a As_cmd.result
end
module Vcs :
sig
type t = [ `Git | `Hg ]
val override_kind : unit -> As_cmd.Vcs.t option
val set_override_kind : As_cmd.Vcs.t option -> unit
val override_exec : unit -> string option
val set_override_exec : string option -> unit
val exists : As_path.t -> As_cmd.Vcs.t -> bool As_cmd.result
val find : As_path.t -> As_cmd.Vcs.t option As_cmd.result
val get : As_path.t -> As_cmd.Vcs.t As_cmd.result
val head :
?dirty:bool -> As_path.t -> As_cmd.Vcs.t -> string As_cmd.result
val describe :
?dirty:bool -> As_path.t -> As_cmd.Vcs.t -> string As_cmd.result
end
val env : string -> string option
val get_env : string -> string As_cmd.result
val exists : string -> bool As_cmd.result
val exec_ret : string -> string list -> int
val exec : string -> string list -> unit As_cmd.result
val read : ?trim:bool -> string -> string list -> string As_cmd.result
val read_lines : string -> string list -> string list As_cmd.result
val write : string -> string list -> As_path.t -> unit As_cmd.result
end