uutils / uutils/coreutils

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

Open
#12,313 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - pr
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Test case: transposing a simple table.
Input data (in.csv):

A,1,2,3
B,1,2,3
C,1,2,3

Used command:

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

Expected output:

A,B,C
1,1,1
2,2,2
3,3,3

Works as expected with GNU pr 9.5.

The output of uutils pr -3 -FTs,

A                      ,B                      ,C
1                      ,1                      ,1
2                      ,2                      ,2
3                      ,3                      ,3

Differences:

  • uutils pr requires number of columns to be specified separately: pr -3 -Ts, otherwise, the following flags don't get processed;
  • for -T to work, it requires -F as well: pr -3 -FTs,, otherwise, -T doesn't work;
  • columns get aligned unconditionally, even when -s, is specified. No difference between -s, and -S,. In GNU pr, the columns only get aligned with the -S flag.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the uutils pr command and reproduce the provided in.csv case using the listed flag combinations, comparing results with GNU pr. Trace option parsing and column formatting for -3, -T, -s, -S, and -F; done means the relevant combinations match GNU behavior and the transposed output is unpadded for -s.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.