Page MenuHomeFreeBSD

du(1): Add --si option and test
ClosedPublic

Authored by kevans on Jul 27 2017, 6:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 10, 9:16 AM
Unknown Object (File)
Dec 22 2023, 11:22 PM
Unknown Object (File)
Dec 20 2023, 7:51 AM
Unknown Object (File)
Nov 7 2023, 9:19 AM
Unknown Object (File)
Oct 6 2023, 1:51 AM
Unknown Object (File)
Aug 3 2023, 5:26 AM
Unknown Object (File)
Jul 14 2023, 11:23 AM
Unknown Object (File)
Jun 25 2023, 10:04 PM
Subscribers

Details

Summary

Add an --si option to du(1) to display in terms of powers of 1000 rather
than powers of 1024

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans rescinded a token.
kevans edited the summary of this revision. (Show Details)

It looks ok to me. Ideally this matches some kind of existing convention. But if not, it's an ok convention to start, too.

usr.bin/du/du.c
499 ↗(On Diff #31245)

misindent?

This revision is now accepted and ready to land.Jul 27 2017, 6:27 AM
In D11748#243528, @cem wrote:

It looks ok to me. Ideally this matches some kind of existing convention. But if not, it's an ok convention to start, too.

This and its df(1) brother-review follow a kind of convention from their GNU counterparts: df exposes -H/--si, du exposes --si

usr.bin/du/du.c
499 ↗(On Diff #31245)

Whoops, will fix in morning or before commit

As a side effect, this change allows options and operands to be mixed in GNU style. Either this should be disabled by prepending "+" to the optstring or this should be mentioned in the commit message.

kevans edited edge metadata.

Address difference in behavior between getopt(3) and getopt_long(3)

This revision now requires review to proceed.Aug 8 2017, 3:19 AM

As a side effect, this change allows options and operands to be mixed in GNU style. Either this should be disabled by prepending "+" to the optstring or this should be mentioned in the commit message.

Thanks for that, I was unfortunately unaware of that detail. I haven't personally used getopt{,_long} all that much, and getopt_long(3) doesn't seem to discuss leading optstring possibilities other than to mention that a leading '+'/'-' are ignored with POSIXLY_CORRECT. =(

I have no intention of changing existing behavior here -- that's a discussion for a different day. =)

emaste added inline comments.
usr.bin/du/du.1
31 ↗(On Diff #31743)

Don't forget to update .Dd before commit.

This revision is now accepted and ready to land.Aug 8 2017, 8:16 PM
This revision was automatically updated to reflect the committed changes.