I am trying to wrap my own CLI args to extend some extra features, run multiple instances of cucumber, and potentially do also more.
I am using clap for my own args, but the problem is as soon as I run cucumber, it also tries to parse the arguments using its own clap defined parser and will stop working saying that arguments are invalid.
Example:
use clap::Parser;
use cucumber::World;
#[derive(World, Debug, Default)]
struct Env;
#[derive(Parser, Debug)]
#[command()]
pub struct Args {
pub targets: Vec<String>,
#[arg(long)]
pub serial: bool,
}
#[tokio::main]
async fn main() {
let args = Args::parse();
for target in args.targets {
Env::run(target).await;
}
}
./target/debug/test_cuc --serial main.feature
error: unexpected argument '--serial' found
Usage: test_cuc [OPTIONS]
For more information, try '--help'.
I am trying to wrap my own CLI args to extend some extra features, run multiple instances of cucumber, and potentially do also more. I am using clap for my own args, but the problem is as soon as I run cucumber, it also tries to parse the arguments using its own clap defined parser and will stop working saying that arguments are invalid.
Example:
./target/debug/test_cuc --serial main.feature
I noticed it happens around this place: https://github.com/cucumber-rs/cucumber/blob/main/src/cucumber.rs#L732 Would it be possible to make the that cli parser optional in some way?