-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix(derive)!: Set both about/long_about with doc comments #3175
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
Also, did you mean to link the correct issue to this PR? |
I dislike the inconsistency with only a few fields providing this (this and `help_heading`) but this is to address a specific bug. We need to visit this, along with iterators (clap-rs#2870) and string handling (clap-rs#2150). `Arg` came along for the ride because the derive logic is applied to both. `PossibleValue` didn't need it because we filter out `long_help`. BREAKING CHANGE: We changed the signatures for `App::about`, `App::long_about`, `Arg::help`, and `Arg::long_help` from accepting anything `Into<&str>` to `&str`.
The main care about is that when we override a `flatten` / `subcommand` doc comment in a parent container, that we make sure we take nothing from the child container, rather than implicitly taking one `about` ut not `long_about`. To do this, and to play the most safe with long help detection, we reset `long_about` to default when there is no doc comment body to use for `long_about`. Fixes clap-rs#2983
pksunkara
approved these changes
Dec 14, 2021
This was referenced Jul 16, 2023
1 task
1 task
1 task
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main care about is that when we override a
flatten
/subcommand
doc comment in a parentcontainer, that we make sure we take nothing from the child container,
rather than implicitly taking one
about
ut notlong_about
.To do this, and to play the most safe with long help detection, we reset
long_about
to default when there is no doc comment body to use forlong_about
.Fixes #2983
BREAKING CHANGE: We changed the signatures for
App::about
,App::long_about
,Arg::help
, andArg::long_help
from accepting anythingInto<&str>
to&str
.