summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-03-03 03:31:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-03-03 03:31:11 +0000
commitbdb225d16306c35f7fd9f61e00fd163478e08a79 (patch)
tree49e4ff34cb5a06bfd1ae088f73975bec6143ba4c
parent225bc7c463ed2ce8e35baceedbbfd05ce82b1db7 (diff)
Give usage message when atq used incorrectly.
-rw-r--r--usr.bin/at/at.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index d6003864d66..79e50a41068 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at.c,v 1.9 1997/03/03 00:30:02 millert Exp $ */
+/* $OpenBSD: at.c,v 1.10 1997/03/03 03:31:10 millert Exp $ */
/* $NetBSD: at.c,v 1.4 1995/03/25 18:13:31 glass Exp $ */
/*
@@ -73,7 +73,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
/* File scope variables */
#ifndef lint
-static char rcsid[] = "$OpenBSD: at.c,v 1.9 1997/03/03 00:30:02 millert Exp $";
+static char rcsid[] = "$OpenBSD: at.c,v 1.10 1997/03/03 03:31:10 millert Exp $";
#endif
char *no_export[] =
@@ -483,9 +483,6 @@ process_jobs(argc, argv, what)
char queue;
int jobno;
- if (optind == argc && (what == ATRM || what == CAT))
- usage();
-
PRIV_START
if (chdir(_PATH_ATJOBS) != 0)
@@ -675,14 +672,20 @@ main(argc, argv)
/* select our program */
switch (program) {
case ATQ:
+ if (optind != argc)
+ usage();
list_jobs();
break;
case ATRM:
+ if (optind == argc)
+ usage();
process_jobs(argc, argv, ATRM);
break;
case CAT:
+ if (optind == argc)
+ usage();
process_jobs(argc, argv, CAT);
break;