From 4afeb40de1509c73881bbe8c63c72a717f8646ef Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 3 Mar 1997 03:31:10 +0000 Subject: [PATCH] Give usage message when atq used incorrectly. --- usr.bin/at/at.c | 13 ++++++++----- 1 file 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; -- 2.20.1