Skip to content

fix: added visible long flag aliases in help #6068

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

Merged
merged 2 commits into from
Jul 30, 2025
Merged

Conversation

GilShoshan94
Copy link
Contributor

@GilShoshan94 GilShoshan94 commented Jul 9, 2025

fix #6067

fix #6073

@GilShoshan94
Copy link
Contributor Author

I will probably have to update the ui tests as well

@GilShoshan94
Copy link
Contributor Author

I updated the ui testes as well in a separated commit

@GilShoshan94
Copy link
Contributor Author

@epage
The PR is ready.

I added the visible long flag aliases, as well as in the debug and adapted the ui tests.
The only thing not strictly necessary I did is to rename in one closure a to s, because it was confusing as a is already the function argument (a: &Command)

@GilShoshan94 GilShoshan94 force-pushed the master branch 3 times, most recently from 3e48808 to 77d6cf5 Compare July 14, 2025 22:06
@GilShoshan94
Copy link
Contributor Author

GilShoshan94 commented Jul 14, 2025

Hi @epage,

I have an issue in the CI because the test I made has the help to wide and I think it wraps.
See the CI error:
image

I tried to fix this, by setting .term_width(usize::MAX) but it didn't help....
.term_width(0) didn't solve it either.

I am still looking for a solution, in case you see this before I solve it, your help and guidance will be appreciated as always.

@GilShoshan94 GilShoshan94 force-pushed the master branch 3 times, most recently from 4aef513 to 6873aaa Compare July 15, 2025 00:21
@GilShoshan94
Copy link
Contributor Author

@epage
I digged more into the help_template.rs to understand why it is wrapping.
I am a bit confused as the test is working fine on my machine....
I tried with .term_width(120) and it did not pass the CI still.

I saw in the code that term_w default to 100, unrelated to the feature wrap_help.
I follow the code, and I don't find why it does not behave the way I expected...
And why it behaves differently in my machine and in the CI...

I added one more test to check all the aliases (visible or not) are working, and I gated the tests for visible aliases under the feature wrap_help.
Now it works.

Let me know if this is good now.

@GilShoshan94 GilShoshan94 requested a review from epage July 15, 2025 00:41
@epage
Copy link
Member

epage commented Jul 18, 2025

Yeah, I'd have to dig more into the wrapping issue. Should be good for now though.

Besides the test issue, this all looks good. Thanks!

@GilShoshan94
Copy link
Contributor Author

Hi @epage,

I fixed the test issue.
It should be ready to be merged now I believe.

@GilShoshan94 GilShoshan94 requested a review from epage July 21, 2025 21:32
@epage
Copy link
Member

epage commented Jul 30, 2025

Thanks!

@epage epage merged commit d527522 into clap-rs:master Jul 30, 2025
25 checks passed
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.

Add some test cases for Command aliases Missing visible long flag aliases in help
2 participants