Skip to content

pr: fix combined flags, -s alignment, and -T pagination#12331

Open
dragutreis wants to merge 1 commit into
uutils:mainfrom
dragutreis:fix/pr-bugs
Open

pr: fix combined flags, -s alignment, and -T pagination#12331
dragutreis wants to merge 1 commit into
uutils:mainfrom
dragutreis:fix/pr-bugs

Conversation

@dragutreis
Copy link
Copy Markdown

Fix pr -3Ts, parsing and formatting issues

Fixes #12313

This fixes a few related issues in pr that showed up when using it to transpose columns, for example:

<in.csv tr , \\n | pr -3Ts,

Fixed issues

  • -3Ts, was not parsed correctly because the argument rewrite step dropped the trailing flags before clap saw them
  • -s still aligned columns with padding spaces.
  • -T removed headers/footers but still left page separators between chunks of output

Changes

  • Split combined args like -3Ts, into -3 and -Ts, during argument preprocessing
  • Disable column alignment when -s is explicitly passed (unless -S is also used)
  • Stop writing page separators when -T / --omit-pagination is active
  • Fixed an extra blank-line case in write_columns under -T

Note

There’s still a pre-existing issue where pagination boundaries are based on page_length - 10 even with -T, so output still wraps every 56 lines instead of 66. That behavior is unchanged in this 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.

pr: flags -T and -s behave differently than in GNU pr

1 participant