-
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
Help text not shown when using doc comment on externalized subcommand #254
Comments
Try this #[derive(Debug, StructOpt)]
enum Subcommand {
/// Create a new task.
New(New),
}
#[derive(Debug, StructOpt)]
struct New {
/// The title of the task.
title: String,
} |
Thanks for your solution! I am leaning towards this approach now as well for other reasons, but there might be situations where it makes more sense to have the description tied to the defining struct, as to make the code documentation more clear. But maybe that is nitpicking ;) |
Can you provide an example and thé behavior you expect? |
Sure. As a bare minimum example:
or
I would expect
|
We may make this possible by allowing |
Funny thing - this is exactly how things work now :) see #333 I'm also closing this since implementing this design variant would be breaking change and structopt is unlikely to have another minor release. It is also very unclear what we should do (and what we can do) if both of the comments are present. |
I have a structure like this:
Invoking
cargo run -- help
yields:It would be great if the doc comment on the externalized subcommand could be used as the help message, instead of having it by the enum cases. The same goes for using the
about
field in thestructopt
attribute.The text was updated successfully, but these errors were encountered: