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
Mangen no longer generates suggestions for options that don't take values #4506
Conversation
The man generation would generate suggestions for all options of values they should take, even if the argument did not take values. This adds a simple check to make sure only options that take values offer a suggestion fixes: clap-rs#4443
@@ -70,6 +70,13 @@ fn possible_values() { | |||
common::assert_matches_path("tests/snapshots/possible_values.bash.roff", cmd); | |||
} | |||
|
|||
#[test] | |||
fn flag_without_value() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you verify the behavior of the test changed with clab_mangen changes? I see other tests using SetTrue but their snapshots didn't change, implying this PR didn't have an affect (see also my other comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I see i was being too naive with the solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange because the change definitely does work on the example provided in the bug report
if let Some(value) = &opt.get_value_names() { | ||
header.push(roman("=")); | ||
header.push(italic(&value.join(" "))); | ||
if opt.get_action().takes_values() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems suspicious. #4432 showed working man pages. We should know what the difference is between the old issue and new issue and discuss it in this PRs issue for which route to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Yeah i'll look at that.
9640297
to
330141c
Compare
330141c
to
e7683bf
Compare
It was noticed that between clap-rs#4443 and clap-rs#4432, an issue in the behavior was that the derive api handles tasks with values slightly differently than the declarative api. Added a test to show parity between declaritive and derive api.
e7683bf
to
d9e5473
Compare
@Calder-Ty whats the status of this PR? |
@epage I've been working on the anstyle-roff parser, and it has given me some new ideas on how to approach this differently. I'm okay with closing this PR and i can push a different one. |
The man generation would generate suggestions for all options of values they should take, even if the argument did not take values. This adds a simple check to make sure only options that take values offer a suggestion.
See examples in underlying issue.
fixes: #4443