Skip to main content

augment

Function augment 

Source
pub fn augment<F>(base: Command, surface: &Surface, decorate: F) -> Command
where F: Fn(Command) -> Command,
Expand description

Add a subcommand for every cassette on the surface.

Cassette nouns are appended to the static ones rather than replacing them, and a cassette whose name collides with a built-in command is skipped: a server must not be able to redefine what a consumer’s own command means on someone’s machine.

decorate is applied to every generated method command; it is where a consumer adds the flags its dispatch reads back (tapesctl adds its --tapes-url, with the TAPES_URL env fallback).