Re: crontab(1): reduce usage()

2021-06-22 Thread Todd C . Miller
On Tue, 22 Jun 2021 13:42:19 +0100, Jason McIntyre wrote:

> diff to reduce verbosity in crontab(1) usage. before:

OK millert@

 - todd



crontab(1): reduce usage()

2021-06-22 Thread Jason McIntyre
hi.

diff to reduce verbosity in crontab(1) usage. before:

$ /usr/bin/crontab -Z
crontab: unknown option -- Z
usage: crontab [-u user] file
   crontab [-e | -l | -r] [-u user]
(default operation is replace, per 1003.2)
-e  (edit user's crontab)
-l  (list user's crontab)
-r  (delete user's crontab)

after:

$ /usr/obj/usr.bin/crontab/crontab -Z
crontab: unknown option -- Z
usage: crontab [-u user] file
   crontab [-e | -l | -r] [-u user]

ok?
jmc

Index: crontab.c
===
RCS file: /cvs/src/usr.sbin/cron/crontab.c,v
retrieving revision 1.94
diff -u -p -r1.94 crontab.c
--- crontab.c   11 Feb 2020 12:42:02 -  1.94
+++ crontab.c   22 Jun 2021 12:41:42 -
@@ -70,11 +70,7 @@ usage(const char *msg)
warnx("usage error: %s", msg);
fprintf(stderr, "usage: %s [-u user] file\n", __progname);
fprintf(stderr, "   %s [-e | -l | -r] [-u user]\n", __progname);
-   fprintf(stderr,
-   "\t\t(default operation is replace, per 1003.2)\n"
-   "\t-e\t(edit user's crontab)\n"
-   "\t-l\t(list user's crontab)\n"
-   "\t-r\t(delete user's crontab)\n");
+
exit(EXIT_FAILURE);
 }