pub trait Command {
// Required methods
fn name(&self) -> &str;
fn execute(&self, args: &[String]);
// Provided methods
fn aliases(&self) -> &[&str] { ... }
fn help(&self) -> Option<&str> { ... }
fn hidden(&self) -> bool { ... }
fn required_caps(&self) -> &[&str] { ... }
fn validate(&self, _args: &[String]) -> Result<(), String> { ... }
fn execute_with(&self, args: &[String], _registry: &CommandRegistry) { ... }
}
Required Methods§
Provided Methods§
fn aliases(&self) -> &[&str]
fn help(&self) -> Option<&str>
Sourcefn required_caps(&self) -> &[&str]
fn required_caps(&self) -> &[&str]
Capability requirements for visibility/authorization. The parent application grants capabilities at runtime on the registry. Default: no requirements.
fn validate(&self, _args: &[String]) -> Result<(), String>
Sourcefn execute_with(&self, args: &[String], _registry: &CommandRegistry)
fn execute_with(&self, args: &[String], _registry: &CommandRegistry)
Execute with access to the registry context. Default delegates to execute
.
Commands that need registry access (e.g., help
) can override this.