diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2017-08-09 01:24:52 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2017-08-09 01:24:52 +0000 |
| commit | d0bc27e435790010108d3b39f6e5ca600adc9a2e (patch) | |
| tree | 680852f591e43b36eecfb96c9e2cf4c07a5561e4 /bin | |
| parent | 30608f6dd668b484c2c3b7239a331759466464e9 (diff) | |
Notes
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/df/df.1 | 4 | ||||
| -rw-r--r-- | bin/df/df.c | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/df/df.1 b/bin/df/df.1 index b5bd83ea1eb1..438edacc8b88 100644 --- a/bin/df/df.1 +++ b/bin/df/df.1 @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd August 8, 2017 .Dt DF 1 .Os .Sh NAME @@ -97,7 +97,7 @@ output. Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and Pebibyte (based on powers of 1024) in order to reduce the number of digits to four or fewer. -.It Fl H +.It Fl H , Fl Fl si .Dq Human-readable output. Use unit suffixes: Byte, Kilobyte, Megabyte, diff --git a/bin/df/df.c b/bin/df/df.c index 017c90d37eec..4373a9b117e8 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include <ufs/ufs/ufsmount.h> #endif #include <err.h> +#include <getopt.h> #include <libutil.h> #include <locale.h> #ifdef MOUNT_CHAR_DEVS @@ -107,6 +108,12 @@ static int thousands; static struct ufs_args mdev; #endif +static const struct option long_options[] = +{ + { "si", no_argument, NULL, 'H' }, + { NULL, no_argument, NULL, 0 }, +}; + int main(int argc, char *argv[]) { @@ -142,7 +149,8 @@ main(int argc, char *argv[]) if (argc < 0) exit(1); - while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T,")) != -1) + while ((ch = getopt_long(argc, argv, "+abcgHhiklmnPt:T,", long_options, + NULL)) != -1) switch (ch) { case 'a': aflag = 1; |
