pub trait Command: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn execute(
&self,
args: &str,
ctx: &mut CommandContext,
) -> Result<CommandResult, CliError>;
// Provided methods
fn aliases(&self) -> Vec<&str> { ... }
fn usage(&self) -> Vec<&str> { ... }
}Expand description
Trait for implementing commands
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get command description for help text
Sourcefn execute(
&self,
args: &str,
ctx: &mut CommandContext,
) -> Result<CommandResult, CliError>
fn execute( &self, args: &str, ctx: &mut CommandContext, ) -> Result<CommandResult, CliError>
Execute the command