Replies: 2 comments 2 replies
-
Could you expand on the semantics? I'm guessing you are defining At first glance, this feels too specialized to have in clap. Someone might want a Not everything has to live in clap though. You can implement the traits yourself. Something like #[derive(Parser)]
struct Opt {
...
#[clap(flatten)]
groups: OptGroups,
}
struct OptGroups {
groups: Vec<OptGroup>,
}
struct OptGroup {
aopt: usize,
bopt: Option<usize>,
copt: usize,
}
impl clap::Args for OptGroups {
...
}
impl clap::FromArgMatches for OptGroups {
...
} You can take advantage of |
Beta Was this translation helpful? Give feedback.
-
Also was looking for this. ffmpeg says: https://manpages.ubuntu.com/manpages/focal/man1/ffmpeg.1.html
My case is I want to process a list of files with optional arguments that can have independent values associated with each file, while at the same time having a few global optional arguments |
Beta Was this translation helpful? Give feedback.
-
Sometimes you would like to have a cli in which arguments are grouped so you expect to have all/some of them set multiple times:
would be nice to have something like
possibly extended to support setting defaults
so that
produces
Beta Was this translation helpful? Give feedback.
All reactions