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, Oct 30, 2:08 PM
Unknown Object (File)
Wed, Oct 30, 2:08 PM
Unknown Object (File)
Wed, Oct 30, 2:08 PM
Unknown Object (File)
Wed, Oct 30, 2:08 PM
Unknown Object (File)
Wed, Oct 30, 2:07 PM
Unknown Object (File)
Wed, Oct 30, 1:51 PM
Unknown Object (File)
Sep 19 2024, 5:00 PM
Unknown Object (File)
Sep 19 2024, 2:58 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 Passed
Unit
No Test Coverage
Build Status
Buildable 10943
Build 11330: arc lint + arc unit

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

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

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

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.