-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subcommand hijacks parent's about #3129
Comments
Comment by TeXitoi Thanks for the clear report. |
Comment by pizzamig This also prevents flattening of struct with their own rustdoc: use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "structopt-bug", about = "Show a bug in Structopt")]
struct Opt {
#[structopt(flatten)]
v: Verbose,
}
/// Re-usable Verbose flag
#[derive(Debug, StructOpt)]
struct Verbose {
/// Enable the verbosity messages
#[structopt(short)]
verbose: bool,
}
fn main() {
let opt = Opt::from_args();
println!("{:?}", opt);
} The
|
epage
added
A-derive
Area: #[derive]` macro API
C-bug
Category: Updating dependencies
labels
Dec 9, 2021
Is this a dup of #3127 ? Is it already fixed? |
Yeah, that's what I was wondering. Didn't you already fix this and #3127? |
Confirmed, this is fixed use clap::StructOpt;
/// The main thing
#[derive(StructOpt)]
struct Main {
#[structopt(subcommand)]
subcommand: Subcommand,
}
/// The subcommand
#[derive(StructOpt)]
enum Subcommand {
A {},
}
fn main() {
Main::from_args();
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue by CodeSandwich
Thursday May 14, 2020 at 09:35 GMT
Originally opened as TeXitoi/structopt#391
I have a simple program:
When I run it with
cargo run -- --help
, I get the following output:The app description should be
The main thing
, notThe subcommand
!The text was updated successfully, but these errors were encountered: