Skip to content

paste: accept a hyphen-leading -d delimiter list - #14321

Merged
cakebaker merged 1 commit into
uutils:mainfrom
arbelonson-source:fix/paste-delimiter-hyphen-value
Aug 31, 2026
Merged

paste: accept a hyphen-leading -d delimiter list#14321
cakebaker merged 1 commit into
uutils:mainfrom
arbelonson-source:fix/paste-delimiter-hyphen-value

Conversation

@arbelonson-source

Copy link
Copy Markdown
Contributor

What

-d's value was rejected as an unrecognized flag when given as its
own argument:

$ paste -d -x f1 f2

# GNU: accepts it, uses '-' as the delimiter (first char of the cycle)
a-1
b-2

# uutils, before this PR:
error: unexpected argument '-x' found
  tip: to pass '-x' as a value, use '-- -x'

The attached forms (-d-x, -d=-x) already worked; only the
separate-argument form broke -- the same allow_hyphen_values gap
already fixed this session for several other options (sort --parallel, nl's numeric options, ptx --gap-size/--width, join -t, csplit --suffix-format).

Testing

  • cargo test -p uu_paste / full tests/by-util/test_paste.rs suite: 21 passed, 0 failed.
  • Added a regression test for the separate-argument hyphen-leading case.
  • Manually diffed -d -x, -d ,, -d -, -d -- against GNU paste 9.11 under LC_ALL=C.
  • cargo clippy -p uu_paste --all-targets -- -D warnings and cargo 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.

-d's value was rejected as an unrecognized flag when given as its own
argument (paste -d -x f1 f2, not the attached -d-x or -d=-x): the Arg
was missing allow_hyphen_values, the same gap already fixed this
session for several other options (sort --parallel, nl's numeric
options, ptx --gap-size/--width, join -t, csplit --suffix-format).
GNU's own -d accepts any argument as the delimiter list regardless of
its first character.

AI-assisted-by: Claude Opus 5, via Claude Code
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/retry (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/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@cakebaker
cakebaker merged commit d1dfeac into uutils:main Aug 31, 2026
101 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

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.

2 participants