Skip to content

pr: write the -o margin once per line - #16718

Open
ihsandeniz wants to merge 1 commit into
uutils:mainfrom
ihsandeniz:fix/pr-offset-once
Open

ihsandeniz wants to merge 1 commit into
uutils:mainfrom
ihsandeniz:fix/pr-offset-once

Conversation

@ihsandeniz

Copy link
Copy Markdown
Contributor

Split out of #16555, as asked there.

The -o margin was written before every column; GNU writes it once per line, before the first column only.

$ printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\nc\n' | pr -t -3 -o 2 '-S|' -w 20
GNU 9.12 / this PR:   "  aaaaaa|bbbbbb|c"
before:               the margin repeated after each separator

The fixture for -o with columns is regenerated from GNU, and there is a new test for two and three columns.

I wrote this with the help of an AI assistant; the expected output comes from running GNU's pr binary.

Like GNU pr, the margin goes before the first column only, not before
every column. The fixture of -o with columns is regenerated.

This branch has not been deployed

No deployments
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