-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: master
Are you sure you want to change the base?
Conversation
I will probably have to update the ui tests as well |
I updated the ui testes as well in a separated commit |
@epage I added the |
@@ -9,9 +9,9 @@ Commands: | |||
more | |||
test Subcommand with one visible alias [aliases: do-stuff] | |||
test_2 several visible aliases [aliases: do-other-stuff, tests] | |||
test_3, --test several visible long flag aliases | |||
test_3, --test several visible long flag aliases [aliases: --testing, --testall, --test_all] |
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.
The fact that no source changed in this commit suggests these commits are not atomic (tests should pass on every commit)
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.
Oh, ok, I will squash them together as one commit.
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.
I will wait for your answer about the commits order you want (in the 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.
tests/builder/flag_subcommands.rs
has a test for visible_short_flag_aliases
, could you
- Add a parallel test for long flag aliases?
- Add a test for both for help output in
tests/builder/help.rs
?
Like normal, ideally new tests would be added in a commit before this one and would pass on that commit.
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.
@epage
Yes, I will add the tests, no problem.
I'm not sure I understand what you want with the commit/git history exactly.
From what I understand, you want:
-
1st commit: add the tests for
long_flag_aliases
intests/builder/flag_subcommands.rs
andtests/builder/help.rs
and fix the tests in UI ?
This commit would result in a failed CI and that would be normal. -
2nd commit: add the fix in
clap_builder/src/output/help_template.rs
to shows the visible long flag aliases.
This commit would pass the CI.
So in total 2 commits, one to fix and update the tests, the second to fix the source code.
Did I understand correctly?
Shall I do that?
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.
Commit 1: Adds tests, cargo test
should pass: this means the test shows the current behavior
Commit 2: Change behavior, update tests to reflect the change in behavior.
#5520 serves as an example of this
fix #6067