Update usage line and manpage for du(1)

Do not allow -a and -s to be specified at the same time.
This commit is contained in:
sin 2013-10-17 11:21:15 +01:00
parent ac3a5e0091
commit ac130cbbe0
2 changed files with 9 additions and 2 deletions

6
du.1
View File

@ -3,7 +3,11 @@
du \- display disk usage statistics du \- display disk usage statistics
.SH SYNOPSIS .SH SYNOPSIS
.B du .B du
.RB [ \-a ] .RB [ \-a
.RB |
.B \-s
.RB ]
.RB [ \-k ]
.RI [ file ...] .RI [ file ...]
.SH DESCRIPTION .SH DESCRIPTION
.B du .B du

5
du.c
View File

@ -23,7 +23,7 @@ static void print(long n, char *path);
void void
usage(void) usage(void)
{ {
eprintf("usage: %s [-a] [file...]\n", argv0); eprintf("usage: %s [-a | -s] [-k] [file...]\n", argv0);
} }
int int
@ -46,6 +46,9 @@ main(int argc, char *argv[])
usage(); usage();
} ARGEND; } ARGEND;
if (aflag && sflag)
usage();
bsize = getenv("BLOCKSIZE"); bsize = getenv("BLOCKSIZE");
if (bsize) if (bsize)
blksize = estrtol(bsize, 0); blksize = estrtol(bsize, 0);