Page MenuHomeFreeBSD

tail(1): Add some long options
AbandonedPublic

Authored by kevans on Jan 31 2018, 4:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 19 2024, 9:16 AM
Unknown Object (File)
Feb 20 2024, 9:45 PM
Unknown Object (File)
Dec 20 2023, 2:12 AM
Unknown Object (File)
Nov 5 2023, 10:58 PM
Unknown Object (File)
Oct 4 2023, 9:52 PM
Unknown Object (File)
Sep 30 2023, 9:52 PM
Unknown Object (File)
Jun 15 2023, 6:55 AM
Unknown Object (File)
Mar 3 2023, 4:23 PM
Subscribers

Details

Summary

Add --blocks, --bytes, and --lines long options for -b, -c, and -n respectively. This improves tail(1)'s compatibility with its GNU counterpart in a straightforward way.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 14718

Event Timeline

This revision is now accepted and ready to land.Jan 31 2018, 4:13 AM
tail/tail.c
67 ↗(On Diff #38699)

don't forget to update usage too

love the idea of this, couple of minor quibbles.

tail/tail.1
76 ↗(On Diff #38699)

elsewhere this is Fl -blocks, a custom I've continued. I'd hold off committing until Warren gives this the nod. Likely worth a one-liner in style(9).

tail/tail.c
67 ↗(On Diff #38699)

usage not updated.

tail/tail.1
76 ↗(On Diff #38699)

For what it's worth, I copied this convention from grep(1), so I wasn't trying to go completely off the reservation. We should probably make a pass and address a lot of this so we're consistent.

tail/tail.c
67 ↗(On Diff #38699)

I didn't update usage because we don't tend to document long option alternatives to existing flags, from what I can tell. I use both sed and grep here as examples.

bjk added inline comments.
tail/tail.1
76 ↗(On Diff #38699)

If we're taking a poll, I'm used to `.Fl -blocks``` for long options.

Switch to Fl -longopt instead of Fl Fl longopt; the former looks cleaner and is a much nicer convention

I've still left these out of usage for the time being, because I'm still not entirely sure it needs updated- I'm still (slightly) searching for an example where we actually document the long option alternative to a short option in usage. Everything I've found so far never documents both in usage, and it prefers the short option when possible.

This revision now requires review to proceed.Feb 1 2018, 3:24 AM

Committed, but Phabricator won't give me the option to just close it.