about summary refs log tree commit diff
path: root/mlist.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-26 21:57:54 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-26 21:59:26 +0200
commit3257fce1b8f00ced0807db7b4263ab855f296aa8 (patch)
tree47a954f8f5706718158b5a27b71daeb1d0f0b012 /mlist.c
parent7e33bac77e74f1a8208c01c6b31f83fe4c35a1ee (diff)
downloadmblaze-3257fce1b8f00ced0807db7b4263ab855f296aa8.tar.gz
mblaze-3257fce1b8f00ced0807db7b4263ab855f296aa8.tar.xz
mblaze-3257fce1b8f00ced0807db7b4263ab855f296aa8.zip
mlist: add usage
Diffstat (limited to 'mlist.c')
-rw-r--r--mlist.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mlist.c b/mlist.c
index bf12c4d..5aaf380 100644
--- a/mlist.c
+++ b/mlist.c
@@ -161,7 +161,7 @@ int
 main(int argc, char *argv[])
 {
 	int c;
-	while ((c = getopt(argc, argv, "PRSTDFprstdfX:x:NnCcim:")) != -1)
+	while ((c = getopt(argc, argv, "PRSTDFprstdfX:x:NnCci")) != -1)
 		switch(c) {
 		case 'P': case 'R': case 'S': case 'T': case 'D': case 'F':
 			flags[(unsigned int)c] = 1;
@@ -182,12 +182,20 @@ main(int argc, char *argv[])
 		case 'C': Cflag = 1; break;
 		case 'c': Cflag = -1; break;
 		case 'i': iflag = 1; break;
-		case 'm': // XXX todo
 		default:
-			// XXX usage
+		usage:
+			fprintf(stderr,
+			    "Usage: mlist [-DFPRST] [-X str]\n"
+			    "             [-dfprst] [-x str]\n"
+			    "             [-N | -n | -C | -c]\n"
+			    "             [-i] dirs...\n"
+			);
 			exit(1);
 		}
 
+	if (optind == argc)
+		goto usage;
+
         int i;
 	
 	for (i = 0, flagsum = 0, flagset = 0; (size_t)i < sizeof flags; i++) {