gumdrop
gumdrop copied to clipboard
Nested types (flatten args)
It would be really nice if the following worked, in order to enable re-use of options between multiple commands:
#[derive(Options)]
struct CommonOpts {
foo: bool,
}
#[derive(Options)]
struct Opts {
bar: bool,
#[options(flatten)]
common: CommonOpts,
}
// call using `program --foo --bar`
This would be nice, but it's looking rather tricky to implement given the code currently generated for Options::parse, which is kind of a mess (see here).
However, I'd like to keep this issue open to remind me to implement this feature as part of a future refactor.
Yeah. I tried doing manually (ie, not using derive), but I gave up mostly due to &'static str return types all over the place. Went back to structopt for now.