Skip to content

paste, join: support attached '-d=' / '-t=' single-'=' separators - #14148

Open
MadeNavaneeth wants to merge 2 commits into
uutils:mainfrom
MadeNavaneeth:fix/paste-join-equals-separator
Open

paste, join: support attached '-d=' / '-t=' single-'=' separators#14148
MadeNavaneeth wants to merge 2 commits into
uutils:mainfrom
MadeNavaneeth:fix/paste-join-equals-separator

Conversation

@MadeNavaneeth

Copy link
Copy Markdown
Contributor

Problem

While fixing #14120 (sort -t=), a systematic check of other utilities with single-character separator flags found the same clap limitation still unhandled in two more places:

command expected (GNU) actual before
paste -d= f1 f2 a=x / b=y ax / by — delimiter silently lost
join -t= f1 f2 merged on = empty output — no rows matched

Clap strips the first = after a short option, so the separator arrived as an empty string. cut already works around this for -d= (#2424), and #14144 does it for sort -t=.

Fix

  • paste: rewrite attached -d<chars> to --delimiters=<chars> before parsing
  • join: split attached -t<chars> into -t <chars> (join's -t has no long form; the separate form passes through verbatim). Caret diagnostics keep echoing the arguments as typed, per the guidance in clap_localization.rs.

Both rewrites preserve separators containing further = characters, and separate-form usage (paste -d =, join -t =) is untouched.

Testing

  • paste: new equals-delim-attached case in the EXAMPLE_DATA table (1=2, a=b)
  • join: new test_separator_attached_equals asserting GNU output byte-exact (1=a=b, 2=b=c)
  • Full suite: 4702 passed; the only failure (test_human_numeric_blank_thousands_sep_locale) fails identically on clean master in this environment
  • clippy and rustfmt clean for both crates

@sylvestre
sylvestre force-pushed the fix/paste-join-equals-separator branch from 040b824 to 9c92a3e Compare August 26, 2026 09:01
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/join/join. tests/join/join is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/retry (passes in this run but fails in the 'main' branch)

@sylvestre
sylvestre force-pushed the fix/paste-join-equals-separator branch from 9c92a3e to 676c1bd Compare August 26, 2026 10:10
@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 398 skipped benchmarks1


Comparing MadeNavaneeth:fix/paste-join-equals-separator (a63a42e) with main (1a6fb19)2

Open in CodSpeed

Footnotes

  1. 398 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (7d10e5b) during the generation of this report, so 1a6fb19 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@MadeNavaneeth
MadeNavaneeth force-pushed the fix/paste-join-equals-separator branch from 676c1bd to 3e15970 Compare August 26, 2026 12:34
@sylvestre
sylvestre force-pushed the fix/paste-join-equals-separator branch from 3e15970 to c8d7af5 Compare August 26, 2026 16:26
Clap strips the first '=' after a short option, so 'paste -d=' lost the
delimiter entirely ('a=x' printed as 'ax'). Rewrite attached '-d<chars>'
to the long form before parsing, mirroring cut's '-d=' workaround
(uutils#2424). GNU paste accepts this form.
Same clap limitation as in cut/sort/paste: 'join -t=' stripped the '=',
so no rows matched and output was empty. Split attached '-t<chars>'
into '-t <chars>' (which clap passes through verbatim), keeping caret
diagnostics on the arguments as typed.

Fixes the empty-output case; GNU accepts 'join -t=' per its docs.
@MadeNavaneeth
MadeNavaneeth force-pushed the fix/paste-join-equals-separator branch from c8d7af5 to a63a42e Compare August 27, 2026 04:54
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.

1 participant