-
Is it possible to have something like this:
I get this error when I try: |
Beta Was this translation helpful? Give feedback.
Answered by
epage
Jul 30, 2024
Replies: 1 comment 7 replies
-
If I understand correctly, you are doing something like #[derive(Debug, Default, clap::Parser, Clone, PartialEq, Eq)]
pub struct Cli {
#[command(flatten)]
plant: PlantArgs,
#[command(flatten)]
wood: WoodArgs,
}
#[derive(Debug, Default, clap::Args, Clone, PartialEq, Eq)]
pub struct PlantArgs {
#[clap(long, env)]
pub type: String,
}
#[derive(Debug, Default, clap::Args, Clone, PartialEq, Eq)]
pub struct WoodArgs {
#[clap(long, env)]
pub type: String,
} And you want the two Do they need to be declared independent or can one have a reference to the other? Are you using subcommands also? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, right, the
Arg::id
or