pub trait Runnable {
// Required method
fn run(&self, ctx: &RunContext) -> Result<()>;
// Provided methods
fn supported_formats(&self) -> &[Format] { ... }
fn supports_dry_run(&self) -> bool { ... }
}Expand description
A CLI subcommand that can be executed.
Required Methods§
Provided Methods§
Sourcefn supported_formats(&self) -> &[Format]
fn supported_formats(&self) -> &[Format]
Output formats this command supports.
The default is text and modern. Commands that also support JSON
should override this to include Format::Json.
Sourcefn supports_dry_run(&self) -> bool
fn supports_dry_run(&self) -> bool
Whether this command supports the global –dry-run flag.
Commands that do not support dry-run will cause an error if the user
passes –dry-run. Override this to return true in commands that
handle the flag.