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
Unknown Object (File)
Thu, Jun 13, 4:29 AM
Unknown Object (File)
May 6 2024, 4:53 AM
Unknown Object (File)
May 6 2024, 4:53 AM
Unknown Object (File)
May 5 2024, 12:46 PM
Unknown Object (File)
May 3 2024, 4:00 AM
Unknown Object (File)
Apr 28 2024, 12:30 PM
Unknown Object (File)
Apr 28 2024, 12:30 PM
Unknown Object (File)
Apr 28 2024, 12:29 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.