Skip to main content

KnowledgeBaseCliExtension

Trait KnowledgeBaseCliExtension 

Source
pub trait KnowledgeBaseCliExtension: KnowledgeBaseExtension {
    // Required methods
    fn command(&self) -> Command;
    fn requires_repository(&self, matches: &ArgMatches) -> bool;
    fn execute(
        &self,
        matches: &ArgMatches,
        context: ExtensionCommandContext<'_>,
    ) -> Result<ExitCode, CliError>;
}
Expand description

Optional CLI behavior for one statically compiled extension.

Required Methods§

Source

fn command(&self) -> Command

The static command inserted below knowledge-base extension.

Source

fn requires_repository(&self, matches: &ArgMatches) -> bool

Whether the selected command requires a configured and activated repository.

Source

fn execute( &self, matches: &ArgMatches, context: ExtensionCommandContext<'_>, ) -> Result<ExitCode, CliError>

Executes a parsed extension command.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§