pr: flags -T and -s behave differently than in GNU pr
Open
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
prrequires number of columns to be specified separately:pr -3 -Ts,otherwise, the following flags don't get processed; - for
-Tto work, it requires-Fas well:pr -3 -FTs,, otherwise,-Tdoesn't work; - columns get aligned unconditionally, even when
-s,is specified. No difference between-s,and-S,. In GNUpr, the columns only get aligned with the-Sflag.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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