Trait hacker_news::cli::HnCommand[][src]

pub trait HnCommand {
    const NAME: &'static str;

    fn parser<'a, 'b>() -> App<'a, 'b>;
fn cmd(matches: &ArgMatches<'_>) -> Result<(), Box<dyn Error>>; }
Expand description

A trait defining the interface to add a subcommand to the command line application.

Associated Constants

The name of this subcommand. Will be used at the command line interface to name this subcommand.

Required methods

A function which returns a clap App instance. This App will be used as a subcommand in the over all command line application structure.

The command executed when this subcommand is actually run. This function receives a clap ArgMatches instance, which can drive optional or argument based logic.

Implementors