Page MenuHomeFreeBSD

column(1): add -l flag
ClosedPublic

Authored by ivy on Sat, May 10, 9:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 31, 4:16 PM
Unknown Object (File)
Thu, May 22, 4:21 PM
Unknown Object (File)
Mon, May 19, 9:49 AM
Unknown Object (File)
Fri, May 16, 11:04 AM
Unknown Object (File)
Fri, May 16, 4:54 AM
Unknown Object (File)
Fri, May 16, 1:13 AM
Unknown Object (File)
Thu, May 15, 9:01 PM
Unknown Object (File)
Thu, May 15, 8:06 PM
Subscribers

Details

Reviewers
des
kevans
Group Reviewers
manpages
Commits
rG313713b24c6d: column(1): add -l flag
Summary

the '-l <tblcols>' flag limits the number of columns that column(1) will
produce in -t mode. this is syntax-compatible with the same option in
util-linux's column(1), but due to existing differences between the two
implementations, it's not semantically compatible.

as a side-effect, fix a pre-existing bug where empty fields could cause
incorrect output:

% echo ':' | column -ts:
(null)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64123
Build 61007: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Sat, May 10, 9:38 PM

will bump Dd before landing

Manual looks fine to me.

des requested changes to this revision.Sun, May 11, 12:33 PM
des added inline comments.
usr.bin/column/column.c
100

I'd prefer strtonum() here (and for termwidth above, while you're at it). See for instance rGd7399551b028.

243
259

When breaking an expression across two or more lines, the operator goes at the end of the first line, not the start of the second.

This revision now requires changes to proceed.Sun, May 11, 12:33 PM
usr.bin/column/column.c
346–347

if you're in the mood, this blank line is no longer required by style(9)

ivy marked 4 inline comments as done.

review fixes

des added inline comments.
usr.bin/column/column.1
28

don't forget to bump!

usr.bin/column/column.c
72

nit: errstr should come first (size, then name)

104

preexisting nit: this multiplication can overflow, using calloc() instead is safer as it deals with that possibility for you (as long as you don't mind the negligible added cost possibly having to zero the newly allocated memory)

This revision is now accepted and ready to land.Tue, May 13, 10:25 AM
This revision was automatically updated to reflect the committed changes.