package tezos-clic

  1. Overview
  2. Docs
Tezos: library of auto-documented command-line-parsing combinators

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.0.tar.gz
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b

doc/tezos-clic.unix/Tezos_clic_unix/Scriptable/index.html

Module Tezos_clic_unix.ScriptableSource

Manage a common "--for-script <FORMAT>" option to make the output of certain commands script-friendly.

Sourcetype output_format

A representation of the output format.

Sourceval clic_arg : unit -> (output_format option, _) Tezos_clic.arg

Command line argument for Tezos_clic.command (and the Tezos_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.

Sourceval 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.t

output 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 ().

Sourceval 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.t

Same as output but for a single row of data.

Sourceval output_for_human : output_format option -> (unit -> unit Tezos_error_monad.Error_monad.tzresult Lwt.t) -> unit Tezos_error_monad.Error_monad.tzresult Lwt.t

output_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.

OCaml

Innovation. Community. Security.