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)
Tue, Jun 25, 6:57 AM
Unknown Object (File)
May 29 2024, 6:08 PM
Unknown Object (File)
May 18 2024, 2:34 PM
Unknown Object (File)
May 8 2024, 4:43 PM
Unknown Object (File)
May 5 2024, 12:37 AM
Unknown Object (File)
Apr 26 2024, 8:43 PM
Unknown Object (File)
Apr 26 2024, 2:01 AM
Unknown Object (File)
Mar 19 2024, 9:16 AM
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 14688

Event Timeline

This revision is now accepted and ready to land.Jan 31 2018, 4:13 AM
tail/tail.c
67

don't forget to update usage too

love the idea of this, couple of minor quibbles.

tail/tail.1
76

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

usage not updated.

tail/tail.1
76

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

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

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.