join: accept a hyphen-leading -t separator, quote it in the error - #14318
Open
arbelonson-source wants to merge 1 commit into
Open
join: accept a hyphen-leading -t separator, quote it in the error#14318arbelonson-source wants to merge 1 commit into
arbelonson-source wants to merge 1 commit into
Conversation
-t's value was rejected as an unrecognized flag when given as its own argument (`join -t -x f1 f2`, not the attached `-tx` or `-t=x`): the Arg was missing allow_hyphen_values, which every other option fixed this way this session was too. GNU's own -t accepts any single argument as the separator regardless of its first character. Also quotes the value in the resulting "multi-character tab" message to match GNU (`multi-character tab 'ab'`, not `multi-character tab ab`) -- a separate, pre-existing bug in the same message that this fix's own test would otherwise still fail against, since a hyphen-leading multi-character value now reaches the exact same message construction as any other one. AI-assisted-by: Claude Opus 5, via Claude Code
|
GNU testsuite comparison: |
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.
What
-t's value was rejected as an unrecognized flag when given as itsown argument:
The attached forms (
-t-x,-t=x) already worked; only theseparate-argument form broke, the same
allow_hyphen_valuesgapalready fixed this session for
sort --parallel,nl's numericoptions, and
ptx --gap-size/--width.Also fixed
The resulting "multi-character tab" message doesn't quote the value,
a separate, pre-existing bug in the same code path (reachable before
this fix too, just via a non-hyphen multi-character value like
-t ab, not only the hyphen-leading one this PR is really about):Fixed since this fix's own regression test for the hyphen-leading
case would otherwise still fail against it -- a hyphen-leading
multi-character value reaches the exact same message construction as
any other one.
Testing
cargo test -p uu_join/ fulltests/by-util/test_join.rssuite: 46 passed, 0 failed.tab_multi_charactertest, which had encoded the unquoted wording as the expected result.-t -x,-t ab,-t :,-t -against GNU join 9.11 underLC_ALL=C.cargo clippy -p uu_join --all-targets -- -D warningsandcargo fmt --check: clean.This PR was written with AI assistance (Claude Opus 5, via Claude Code). I've tested the changes but please review the code carefully.