CliTask

Trait CliTask 

Source
pub trait CliTask {
    // Required methods
    fn subcommand(&self) -> Command;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        matches: &'life1 ArgMatches,
        bootstrapper: Bootstrapper<WithConfig>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait for defining a CLI command.

This is meant to be used with Cli::add_task inside cot::project::Project::register_tasks.

Required Methods§

Source

fn subcommand(&self) -> Command

Returns the definition of the task’s options as the clap crate’s Command.

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 mut self, matches: &'life1 ArgMatches, bootstrapper: Bootstrapper<WithConfig>, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes the task with the given matches and project.

Implementors§