[][src]Struct shli::completion::Command

pub struct Command {
    pub name: String,
    pub args: Vec<Argument>,
    pub subcommands: Vec<Command>,
}

Possible (sub)command displayed in tab completion.

The arguments right from a (sub)command may be flags, arbitrary arguments or even subcommands. They all can be displayed or even tab-completed, when described in this data structure's attributes.

Fields

name: Stringargs: Vec<Argument>subcommands: Vec<Command>

Methods

impl Command[src]

pub fn new(name: &str) -> Command[src]

Create a new instance by specifying the command's name

pub fn subcommand(self, cmd: Command) -> Command[src]

Add a subcommand to this command

pub fn arg<T: Into<Argument>>(self, arg: T) -> Command[src]

Add a concrete argument (e.g. a flag) to this command

Auto Trait Implementations

impl RefUnwindSafe for Command

impl Send for Command

impl Sync for Command

impl Unpin for Command

impl UnwindSafe for Command

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.