Repository navigation
uniq: take digits after -f, -s or -w as their value - #16867
Merged
Merged
Conversation
|
GNU testsuite comparison: |
sylvestre
reviewed
Nov 27, 2026
| #[rstest] | ||
| #[case::skip_fields("-cf2", " 3 a x 1\n 1 d z 2\n")] | ||
| #[case::skip_chars("-us4", "d z 2\n")] | ||
| #[case::check_chars("-cw1", " 1 a x 1\n 1 b y 1\n 1 c y 1\n 1 d z 2\n")] |
Contributor
There was a problem hiding this comment.
with this input the output is the same without -w1, could you use lines where it matters? (e.g. "ab\nac\n")
Contributor
Author
There was a problem hiding this comment.
Right, changed the input to a x 1\na y 1\nc y 1\nd z 2\n so -cw1 folds the first two lines (plain -c keeps all four apart). The other two cases give the same output as before.
In a cluster like -cf2 the digits were read as the obsolete -N field count, which left -f without a value.
sylvestre
force-pushed
the
uniq-cluster-option-value
branch
from
November 27, 2026 12:14
8010313 to
4bcc2cf
Compare
sylvestre
reviewed
Nov 27, 2026
| obs_overwritten_by_new = true; | ||
| } | ||
| // Digits after -f, -s or -w are that option's value, as in `-cf2` | ||
| if matches!(*c, 'f' | 's' | 'w') { |
Contributor
There was a problem hiding this comment.
maybe it should be an enum in the future
Contributor
|
Thanks for your PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a cluster like
-cf2, the digits afterf,sorwwere read as the obsolete-Nfield count, which left the option without a value. Digits are now only taken as-Nbefore one of those letters.Closes #16866