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

Added basic argument ordering to clap_man #3373

Closed
wants to merge 3 commits into from

Conversation

cgubbin
Copy link

@cgubbin cgubbin commented Jan 31, 2022

#3362 I have tried to add basic argument ordering to clap_man. To do this I had to reach up into the main clap crate, to expose the method get_display_order().

The added code is currently quite verbose because I am printing the --help argument first, and then printing the remaining arguments in order which has resulted in some duplication... This ordering makes sense to me but might not be the style wanted. I have also added a unit test to verify that the arguments appear in the desired order in both the Synopsis and Options sections of the manual.

clap_man/src/render.rs Outdated Show resolved Hide resolved
clap_man/src/render.rs Outdated Show resolved Hide resolved
@epage epage added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 1, 2022
@cgubbin
Copy link
Author

cgubbin commented Feb 5, 2022

I updated as suggested, utilising display order, followed by an alphabetical ordering for options with equal display order.

clap_man/src/render.rs Outdated Show resolved Hide resolved
@epage
Copy link
Member

epage commented Feb 14, 2022

Looks like this needs to be rebased

@epage
Copy link
Member

epage commented Mar 7, 2022

btw #3544 switched how we test clap_mangen.

ducaale added a commit to ducaale/xh that referenced this pull request Sep 11, 2022
Otherwise, the order of arguments changes, which AFAIK is not
resettable.

Also, see clap-rs/clap#3373 which exposes
an internal method for reading derived order values for arguments.
@epage
Copy link
Member

epage commented Jan 3, 2023

@cgubbin do you plan to get back to this PR or should we close it?

@epage
Copy link
Member

epage commented Mar 27, 2023

As its been several months without a response, I'm going to go ahead and close this. If/when you come back to this, feel free to open a new PR

@epage epage closed this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants