Type Alias cli_rs::command::Command

source ·
pub type Command<'a> = Command0<'a>;

Aliased Type§

struct Command<'a> {
    pub docs: DocInfo,
    pub subcommands: Vec<Box<dyn Cmd + 'a, Global>, Global>,
    pub handler: Option<Box<dyn FnMut() -> Result<(), CliError> + 'a, Global>>,
}

Fields§

§docs: DocInfo§subcommands: Vec<Box<dyn Cmd + 'a, Global>, Global>§handler: Option<Box<dyn FnMut() -> Result<(), CliError> + 'a, Global>>

Implementations§

source§

impl<'a> Command0<'a>

source

pub fn name(name: &str) -> Self

source

pub fn with_completions(self) -> Self

source

pub fn description(self, description: &str) -> Self

source

pub fn input<T1: Input>(self, in1: T1) -> Command1<'a, T1>

source

pub fn handler<F>(self, handler: F) -> Selfwhere F: FnMut() -> CliResult<()> + 'a,

source

pub fn subcommand<C: Cmd + 'a>(self, sub: C) -> Self

Trait Implementations§

source§

impl<'a> ParserInfo for Command0<'a>

source§

fn docs(&self) -> &DocInfo

source§

fn symbols(&mut self) -> Vec<&mut dyn Input>

source§

fn subcommand_docs(&self) -> Vec<DocInfo>

source§

fn call_handler(&mut self) -> CliResult<()>

source§

fn push_parent(&mut self, parents: &[String])

source§

fn complete_subcommand( &mut self, sub_idx: usize, tokens: &[String] ) -> Result<(), CliError>

source§

fn parse_subcommand( &mut self, sub_idx: usize, tokens: &[String] ) -> Result<(), CliError>