Trait cucumber::cli::Args

source ·
pub trait Args: Sized + FromArgMatches {
    // Required methods
    fn augment_args(cmd: Command) -> Command;
    fn augment_args_for_update(cmd: Command) -> Command;

    // Provided method
    fn group_id() -> Option<Id> { ... }
}
Expand description

Parse a set of arguments into a user-defined container.

Implementing this trait lets a parent container delegate argument parsing behavior to Self. with:

  • #[command(flatten)] args: ChildArgs: Attribute can only be used with struct fields that impl Args.
  • Variant(ChildArgs): No attribute is used with enum variants that impl Args.

NOTE: Deriving requires the derive feature flag

Required Methods§

source

fn augment_args(cmd: Command) -> Command

Append to Command so it can instantiate Self.

See also CommandFactory.

source

fn augment_args_for_update(cmd: Command) -> Command

Append to Command so it can update self.

This is used to implement #[command(flatten)]

See also CommandFactory.

Provided Methods§

source

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Args for Box<T>
where T: Args,

Implementors§

source§

impl Args for cucumber::parser::basic::Cli

source§

impl Args for cucumber::runner::basic::Cli

source§

impl Args for cucumber::writer::basic::Cli

source§

impl Args for cucumber::writer::junit::Cli

Available on crate feature output-junit only.
source§

impl Args for cucumber::writer::libtest::Cli

Available on crate feature libtest only.
source§

impl Args for Empty

source§

impl<L: Args, R: Args> Args for Compose<L, R>

source§

impl<Parser, Runner, Writer, Custom> Args for Opts<Parser, Runner, Writer, Custom>
where Parser: Args, Runner: Args, Writer: Args, Custom: Args,