package tezos-clic
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=6b33e0549574c89a63538c94ce5555dd141e3c0fb5d934abff07d702fa3244d2
sha512=681a197baabec6e2f806871d43490382243207518f8fcf932741cd314d8717e46db2b6a5adc222f8726083a5dd911083b4931b7e878ab815f8f1a32763d1bf93
doc/tezos-clic.unix/Tezos_clic_unix/Scriptable/index.html
Module Tezos_clic_unix.Scriptable
Manage a common "--for-script <FORMAT>" option to make the output of certain commands script-friendly.
val clic_arg : unit -> (output_format option, _) Tezos_clic.Clic.argCommand line argument for Clic.command (and the Clic.args* functions). Not that this is the only way to obtain a value of type output_format. On the command line, it appears as --for-script with values TSV or CSV.
val output :
?channel:Lwt_io.output_channel ->
output_format option ->
for_human:(unit -> unit Tezos_error_monad.Error_monad.tzresult Lwt.t) ->
for_script:(unit -> string list list) ->
unit Tezos_error_monad.Error_monad.tzresult Lwt.toutput fmt_opt ~for_human ~for_script behaves in one of two ways. If fmt_opt is Some _, then it formats the value returned by for_script (). The function's return value is formatted as lines of columns of values (list of lists of strings). This is to help scripts to decode/interpret/parse the output. Otherwise, if fmt_opt is None, it calls for_human () which is responsible for the whole formatting.
The optional argument channel is used when automatically formatting the value returned by for_script (). It has no effect on for_human ().
val output_row :
?channel:Lwt_io.output_channel ->
output_format option ->
for_human:(unit -> unit Tezos_error_monad.Error_monad.tzresult Lwt.t) ->
for_script:(unit -> string list) ->
unit Tezos_error_monad.Error_monad.tzresult Lwt.tSame as output but for a single row of data.
val output_for_human :
output_format option ->
(unit -> unit Tezos_error_monad.Error_monad.tzresult Lwt.t) ->
unit Tezos_error_monad.Error_monad.tzresult Lwt.toutput_for_human fmt_opt for_human behaves in either of two ways. If fmt_opt is None, then it calls for_human (). Otherwise, it does nothing.
Use this function to provide output that is of no interest to automatic tools.