Skip to content
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: Show possible values in generated man file #4082

Merged
merged 4 commits into from Aug 24, 2022

Conversation

Calder-Ty
Copy link
Contributor

This adds feature parity for mangen with the standard help output. Users
will now see the list of possible values for value arguments.

One change that was made to make this possible was adding the method
get_possible_values to the public API for an arg. I tried to think of
a way to get around this, but because this is the interface that the
help generation uses, and it is part of the crate public interface
I thing adding it as a part of the public API might be for the best.
If that is not the best option, please let me know and i can go back and look at it.

fixes: #3861

@Calder-Ty Calder-Ty changed the title fix: show possible values in generated man file fix: Show possible values in generated man file Aug 16, 2022
Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving the man generation forward!

clap_mangen/src/render.rs Outdated Show resolved Hide resolved
clap_mangen/src/render.rs Outdated Show resolved Hide resolved
@Calder-Ty Calder-Ty force-pushed the bugfix/3861 branch 3 times, most recently from 890245f to 8308815 Compare August 20, 2022 20:40
@Calder-Ty
Copy link
Contributor Author

Appologies for the wait getting back on this feedback. The noted changes should be reflected in the latest updates

clap_mangen/src/render.rs Outdated Show resolved Hide resolved
clap_mangen/src/render.rs Outdated Show resolved Hide resolved
clap_mangen/tests/snapshots/value_hint.bash.roff Outdated Show resolved Hide resolved
Calder-Ty and others added 4 commits August 23, 2022 21:47
This adds feature parity for mangen with the standard help output. Users
will now see the list of possible values for value arguments.

One change that was made to make this possible was adding the method
`get_possible_values` to the public API for an arg. I tried to think of
a way to get around this, but because this is the interface that the
help generation uses, and it is part of the crate public interface
I thing adding it as a part of the public API might be for the best.

fixes: clap-rs#3861
This makes sure we take into account the setting that possible args
is hidden
Noticed that possible values would not show up for Positional arguments
as well. Decided to add the changes for those as well.
@epage epage merged commit 79bdeb2 into clap-rs:master Aug 24, 2022
@epage
Copy link
Member

epage commented Aug 24, 2022

Thanks!

This was made against master which is v4. If you would like, you are welcome to cherry-pick this onto v3-master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[clap_mangen] possible values not shown in generated man page
2 participants