-
Notifications
You must be signed in to change notification settings - Fork 152
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 #391
Labels
bug
This is a BUG. The fix may be released in a patch version even if considered breaking
Comments
TeXitoi
added
the
bug
This is a BUG. The fix may be released in a patch version even if considered breaking
label
May 14, 2020
Thanks for the clear report. |
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
|
6 tasks
fimmind
added a commit
to fimmind/dotmake
that referenced
this issue
Feb 12, 2021
The problem is described in these issues: TeXitoi/structopt#333 TeXitoi/structopt#391 The is easiest workaround is to remove doc comments from `Options` and `Subcommand`
This was referenced Feb 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: