[hackers] [sbase] Update usage line and manpage for du(1) || sin

From: <git_AT_suckless.org>
Date: Thu, 17 Oct 2013 12:27:51 +0200

commit ac130cbbe04f0c16c8c7ca64844645421598ce91
Author: sin <sin_AT_2f30.org>
Date: Thu Oct 17 11:21:15 2013 +0100

    Update usage line and manpage for du(1)
    
    Do not allow -a and -s to be specified at the same time.

diff --git a/du.1 b/du.1
index 3320c8b..f4a0e70 100644
--- a/du.1
+++ b/du.1
_AT_@ -3,7 +3,11 @@
 du \- display disk usage statistics
 .SH SYNOPSIS
 .B du
-.RB [ \-a ]
+.RB [ \-a
+.RB |
+.B \-s
+.RB ]
+.RB [ \-k ]
 .RI [ file ...]
 .SH DESCRIPTION
 .B du
diff --git a/du.c b/du.c
index 4b3ebb0..edb2e50 100644
--- a/du.c
+++ b/du.c
_AT_@ -23,7 +23,7 @@ static void print(long n, char *path);
 void
 usage(void)
 {
- eprintf("usage: %s [-a] [file...]
", argv0);
+ eprintf("usage: %s [-a | -s] [-k] [file...]
", argv0);
 }
 
 int
_AT_@ -46,6 +46,9 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
+ if (aflag && sflag)
+ usage();
+
         bsize = getenv("BLOCKSIZE");
         if (bsize)
                 blksize = estrtol(bsize, 0);
Received on Thu Oct 17 2013 - 12:27:51 CEST

This archive was generated by hypermail 2.3.0 : Thu Oct 17 2013 - 12:36:18 CEST