[][src]Struct combu::command::Command

pub struct Command {
    pub name: String,
    pub action: Option<Action>,
    pub authors: String,
    pub copyright: String,
    pub description: Option<String>,
    pub usage: String,
    pub l_flags: Vector<Flag>,
    pub c_flags: Vector<Flag>,
    pub alias: Vector<String>,
    pub version: String,
    pub sub: Vector<Command>,
    pub help: Option<HelpFunc>,
}

The struct for command

Fields

name: String

Command name

action: Option<Action>

Command action

authors: String

Command authors

copyright: String

Command copyright

description: Option<String>

Command description

usage: String

Command usage

l_flags: Vector<Flag>

local flags of command

c_flags: Vector<Flag>

common flags of command

alias: Vector<String>

alias for command

version: String

Command version

sub: Vector<Command>

container of sub-command

help: Option<HelpFunc>

custom help fuction

Implementations

impl Command[src]

pub fn new() -> Command[src]

pub fn with_name<T: Into<String>>(name: T) -> Command[src]

pub fn build_new(
    name: String,
    action: Option<Action>,
    authors: String,
    copyright: String,
    description: Option<String>,
    usage: String,
    local_flags: Vector<Flag>,
    common_flags: Vector<Flag>,
    alias: Vector<String>,
    version: String,
    sub: Vector<Command>
) -> Command
[src]

pub fn run_with_auto_arg_collect(self)[src]

pub fn single_run(&mut self, raw_args: Vec<String>)[src]

pub fn show_help(&self, c: &Context)[src]

pub fn default_help<'a>(&self, c: &Context) -> String[src]

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

pub fn usage<T: Into<String>>(self, usage: T) -> Self[src]

pub fn action(self, action: Action) -> Self[src]

pub fn authors<T: Into<String>>(self, authors: T) -> Self[src]

pub fn copyright<T: Into<String>>(self, copyright: T) -> Self[src]

pub fn local_flag(self, flag: Flag) -> Self[src]

pub fn common_flag(self, flag: Flag) -> Self[src]

pub fn desctiption<T: Into<String>>(self, description: T) -> Self[src]

pub fn version<T: Into<String>>(self, version: T) -> Self[src]

pub fn sub_command(self, sub_command: Command) -> Self[src]

pub fn alias<T: Into<String>>(self, a: T) -> Self[src]

pub fn help(self, help_function: HelpFunc) -> Self[src]

pub fn is(&self, name_or_alias: &str) -> bool[src]

pub fn take_sub(&mut self, name_or_alias: &str) -> Option<Command>[src]

name_or_aliasに一致するサブコマンドがある場合、保持しているVectorからswap_removeで取り出して返す

pub fn has_sub(&self) -> bool[src]

pub fn derive_route_init_vector(&self) -> Vector<String>[src]

impl Command[src]

pub fn run_from_args(&mut self, raw_args: Vec<String>)[src]

pub fn run_with_context(&mut self, context: Context)[src]

pub fn assign_context(
    &mut self,
    c: Context,
    p: Parser,
    inter_mediate_args: VecDeque<MiddleArg>,
    last: MiddleArg
)
[src]

pub fn assign_run(
    &mut self,
    args: VecDeque<String>,
    inter_mediate_args: VecDeque<MiddleArg>,
    p: Parser,
    raw_args: Vec<String>,
    current_path: String
)
[src]

pub fn handle_action_result(&self, req: Result<ActionResult, ActionError>)[src]

Trait Implementations

impl Clone for Command[src]

impl Default for Command[src]

impl From<String> for Command[src]

impl Run<Context> for Command[src]

impl Run<Vec<String>> for Command[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

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.