Command

Trait Command 

Source
pub trait Command:
    Debug
    + Options
    + Runnable {
    // Required methods
    fn name() -> &'static str;
    fn description() -> &'static str;
    fn version() -> &'static str;
    fn authors() -> &'static str;

    // Provided methods
    fn from_args<A>(into_args: A) -> Self
       where A: IntoIterator<Item = String> { ... }
    fn from_env_args() -> Self { ... }
    fn print_usage_and_exit(args: &[String]) -> ! { ... }
    fn subcommand_usage(_command: &str) -> Option<Usage> { ... }
}
Expand description

Abscissa core prelude Subcommand of an application: derives or otherwise implements the Options trait, but also has a call() method which can be used to invoke the given (sub)command.

Required Methods§

Source

fn name() -> &'static str

Name of this program as a string

Source

fn description() -> &'static str

Description of this program

Source

fn version() -> &'static str

Version of this program

Source

fn authors() -> &'static str

Authors of this program

Provided Methods§

Source

fn from_args<A>(into_args: A) -> Self
where A: IntoIterator<Item = String>,

Parse command-line arguments from a string iterator

Source

fn from_env_args() -> Self

Parse command-line arguments from the environment

Source

fn print_usage_and_exit(args: &[String]) -> !

Print usage information and exit

Source

fn subcommand_usage(_command: &str) -> Option<Usage>

Get usage information for a particular subcommand (if available)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Command for LightNodeCmd

Source§

impl<C> Command for Help<C>
where C: Command,

Source§

impl<Cmd> Command for EntryPoint<Cmd>
where Cmd: Command + Runnable,