Page MenuHomeFreeBSD

getfacl: add some long options for Linux compatibility
ClosedPublic

Authored by kevans on Jun 19 2023, 5:48 AM.
Tags
None
Referenced Files
F167075605: D40602.id123400.diff
Tue, Aug 18, 9:08 PM
F167070179: D40602.id123400.diff
Tue, Aug 18, 8:37 PM
F167055607: D40602.id154008.diff
Tue, Aug 18, 8:08 PM
F167053078: D40602.id154008.diff
Tue, Aug 18, 8:02 PM
F167026067: D40602.id123400.diff
Tue, Aug 18, 3:58 PM
F167025134: D40602.id154008.diff
Tue, Aug 18, 3:54 PM
Unknown Object (File)
Sun, Aug 16, 7:36 PM
Unknown Object (File)
Sat, Aug 15, 8:02 PM
Subscribers

Details

Summary

Only three of our options have compatible looking long options, w.r.t.
the commonly provided getfacl(1) on Linux systems. Of particular
interest is --omit-header, which is -c on !FreeBSD and -q on FreeBSD.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 19 2023, 1:21 PM
olce added inline comments.
bin/getfacl/getfacl.c
62

Is it customary not to mention long options in usage()?

bin/getfacl/getfacl.c
62

[--omit-headers] => [--omit-header]

bin/getfacl/getfacl.c
62

I usually try not to in order to avoid the redundancy (assuming there's an equivalent short opt), but I'm open to suggestions that that's not a good goal to have.

When I first started adding long options to things, my train of thought was that if I see, e.g., both -n and --numeric in a usage statement, I'm going to assume there might be some subtle difference rather than them being two aliases for the same behavior and waste more time than I need to looking at the manpage to understand the non-difference, especially for tools that I'm already familiar with the short opts on.

bin/getfacl/getfacl.c
62

I was mostly asking for my own sake if there was some established implicit policy, and as a reminder for you if there was.

Personally, I'm not sure what would be best either. I think that all options should be listed, but at the same time usage() is supposed to be concise.

As a data point, GNU's getfacl only prints short options on the first line, or if a non-existent flag is input, but prints only long options when --help is passed. GNU coding standards don't seem to say anything hard about long options. But they also say that each command must support --help, which we don't have.

As you know it since you're the author, our ls lists --color, which is not a redundant option.

As for redundant options, [-d|--default] would be closer to what I'd want but far from perfect as well (both forms aren't exclusive but instead completely equivalent). I think we would need another notation for that, perhaps something like (-d|--default).

Anyway, not terribly important for this review/commit, just a side note and food for thoughts on a possible addition to style(9).