Page MenuHomeFreeBSD

Improve usability of head(1) and tail(1):
ClosedPublic

Authored by delphij on Jul 6 2022, 7:32 AM.
Tags
None
Referenced Files
F102623901: D35720.diff
Thu, Nov 14, 11:30 PM
Unknown Object (File)
Thu, Nov 14, 1:35 PM
Unknown Object (File)
Wed, Nov 6, 7:04 PM
Unknown Object (File)
Mon, Nov 4, 1:40 AM
Unknown Object (File)
Thu, Oct 17, 6:22 AM
Unknown Object (File)
Thu, Oct 17, 2:39 AM
Unknown Object (File)
Oct 16 2024, 10:12 AM
Unknown Object (File)
Oct 14 2024, 8:50 PM

Details

Summary
  • Consistently support -q (quiet) and -v (verbose)
  • Allow specifying numbers with SI prefixes supported by expand_number(3)
  • Remove 2^31 limit on lines for head(1)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46346
Build 43235: arc lint + arc unit

Event Timeline

pauamma_gundo.com added inline comments.
usr.bin/head/head.1
88–93

Moving these up to just under

.It Fl n Ar count , Fl -lines Ns = Ns Ar count
Print
.Ar count
lines of each of the specified files.

would make for better flow IMO.

This revision now requires changes to proceed.Jul 8 2022, 10:05 PM
delphij marked an inline comment as done.

Update manual page per reviewer suggestion.

The rendered page would be:

-c bytes, --bytes=bytes
        Print bytes of each of the specified files.

-n count, --lines=count
        Print count lines of each of the specified files.

        Both count and bytes may also be specified with size suffixes
        supported by expand_number(3).

(The indentation was somewhat weird in my opinion, does this look good, or do you have some suggestion in the markup?)

Looks good to me (carefully read the code, but didn't compile and execute it). It would be great if you can add some simple tests to guard those new features.

(The indentation was somewhat weird in my opinion, does this look good, or do you have some suggestion in the markup?)

Good point. I don't know. Unless removing .Pp does the trick, someone more familiar with mdoc will have to answer.

Add test cases for new features.

gbe added a subscriber: gbe.

LGTM for the man page parts.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 13 2022, 4:14 AM
This revision was automatically updated to reflect the committed changes.