Skip to main content

Crate didbot_cli

Crate didbot_cli 

Source
Expand description

What every didbot command shares, so that verbs shipped as separate binaries read as one tool.

didbot <verb> … is a dispatcher: it finds didbot-<binary> on PATH and hands it the rest of the command line. Each binary parses for itself, and this crate is how they all parse the same way: parse over the workspace’s one clap, Server and Json for the two flags every verb takes, Exit for the three statuses a script can rely on, and finish for the one line an error is written as.

FirstPartyVerb is the row type of the table the dispatcher carries. It lives here rather than in the dispatcher so a verb crate’s tests can read the same type the dispatcher does.

Modules§

env
The environment variables a didbot command reads a credential from.
reference
The CLI reference in the workspace’s README.md, made from each binary’s own --help.
tokens
Where an account token lands on the machine that will be the account.

Macros§

version
<binary> <version>, as the binary this expands in answers --version.

Structs§

FirstPartyVerb
A verb the dispatcher knows by name, whether or not its binary is installed.
Json
--json: the answer as one line of JSON on stdout, for a script.
Refusal
Why a command stopped, and how it exits.
Server
--server <HOSTNAME>: which deployment a verb acts on.

Enums§

Exit
How a didbot command exits.

Functions§

finish
Renders an outcome the way every didbot command does.
logs
Sends tracing to stderr, and only what RUST_LOG asks for.
parse
Parses the command line as T.