Skip to content

tac: accept a separator that starts with '-' - #15498

Merged
sylvestre merged 1 commit into
uutils:mainfrom
emirmrkaljevic:tac-separator-hyphen
Oct 19, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
emirmrkaljevic:tac-separator-hyphen

Conversation

@emirmrkaljevic

Copy link
Copy Markdown
Contributor

Summary

tac -s -1 and tac --separator -1 failed with unexpected argument '-1' found, while GNU tac uses -1 as the separator. The separator argument now accepts values starting with - (allow_hyphen_values(true)), the same fix as #15345 for cut --output-delimiter.

$ printf 'a-1b-1' | ./target/debug/tac -s -1
b-1a-1

Fixes #15497

Test plan

  • New test_separator_starting_with_hyphen covers -s -1, --separator -1 and --separator=-1; it fails without the change and passes with it
  • cargo test --no-default-features --features tac test_tac::: 34 passed
  • cargo fmt --check, cargo clippy -p uu_tac --all-targets -- -D warnings
  • Output matches GNU coreutils 9.12 for all three forms

Found with behave.

@sylvestre
sylvestre merged commit 92f7347 into uutils:main Oct 19, 2026
98 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

tac: --separator rejects a value that starts with '-'

2 participants