Module Tezos_layer2_shell.Commands

type ('a, 'state) t

A command taking 'a as arguments, and requiring to be run against a given 'state type.

type 'state command =
  1. | Command : ('a, 'state) t -> 'state command
module Cli : sig ... end

General-purpose command arguments parsers that are likely to be re-used to build ad-hoc commands.

val command : name:string -> parse:'args Cli_parser.t -> run: (Printer.t -> 'state -> 'args -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> ('args, 'state) t

command ~name ~parse ~run creates a new command from a parser and a handler that can be executed on top of a particular state.

val run : Printer.t -> 'state -> ('a, 'state) t -> 'a -> unit Tezos_base.TzPervasives.tzresult Lwt.t

run p state cmd arg executes the command cmd with the provided arg on top of state, using p to print.

val read_eval : args:string list -> 'state command list -> Printer.t -> 'state -> unit Lwt.t

read_eval ~args cmds p state evaluates the unparsed arguments in args as the first command from cmds able to parse them, on top of state, using p to print.

val name : ('a, 'state) t -> string
val ls : subkeys:('state -> string -> string Tezos_base.TzPervasives.trace Lwt.t) -> inspect:('state -> string -> bytes option Lwt.t) -> (string, 'state) t

ls ~subkeys ~inspect is a command listing the sub-directories of a given path.

val cat : inspect:('state -> string -> bytes option Lwt.t) -> (string * Pp.t, 'state) t

cat ~inspect is a command printing the contents stored under a given path, using a specified pretty-printer (hex by default).

val tree : subkeys:('state -> string -> string Tezos_base.TzPervasives.trace Lwt.t) -> (string * int, 'state) t