Skip to main content

Crate didbot

Crate didbot 

Source
Expand description

didbot β€” the one command a person types, and nothing more than a router.

didbot <verb> … finds the binary that answers <verb> and replaces itself with it, handing over the rest of the command line. The first-party verbs are in verbs::FIRST_PARTY, each naming its binary, so a verb whose binary is not installed is answered with what to install. Any other word is didbot-<word> on PATH, which is how someone adds a verb without touching this repository.

The dispatcher passes argv and nothing else. It adds nothing to the environment and removes every variable in didbot_cli::env::CREDENTIALS before handing off: a verb reached this way authenticates for itself, and a program reachable by a typo on didbot- inherits no credential from the shell that ran it.

didbot --list scans PATH for didbot-*, asks each for --version and prints what it found. Every binary is versioned on its own, so a mix of versions shows up here and fails nowhere.

ModulesΒ§

path πŸ”’
Finding binaries on PATH.
run πŸ”’
Running a verb’s binary: the hand-off, and the version probe --list makes.
verbs πŸ”’
The verbs didbot knows by name.

StructsΒ§

Cli πŸ”’

EnumsΒ§

Verb πŸ”’

ConstantsΒ§

PROGRAM πŸ”’
The spelling every refusal from this binary is prefixed with.

FunctionsΒ§

dispatch πŸ”’
Finds the binary for verb and runs it with argv.
list πŸ”’
--list: this binary, then every didbot-* on PATH with what it says to --version, then the first-party binaries that are not installed.
main πŸ”’