aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-01-18 21:35:18 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-01-18 21:35:18 +0000
commitc6a9230f482e45ae93b9edb8b11898cab40e45eb (patch)
treefc2a6f7afce1af7598d69bc86d14581fed1a5686 /bin
parenta836d42f9a7f5a6f36add74716aafb15d902c7c2 (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/df/df.14
-rw-r--r--bin/df/df.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/df/df.1 b/bin/df/df.1
index 823e585785d6..aae551eaceac 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 9559e4ac6289..b501e71c6b52 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;