From 735c5fc64b1118c8abca7a8218c170ba408ad1a0 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 10 Jun 1994 18:51:37 +0000 Subject: [PATCH] Added the -q option which disables the bell in the case of an error git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3707 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kdestroy/kdestroy.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/clients/kdestroy/kdestroy.c b/src/clients/kdestroy/kdestroy.c index 1c903c216..52ca911f9 100644 --- a/src/clients/kdestroy/kdestroy.c +++ b/src/clients/kdestroy/kdestroy.c @@ -50,14 +50,18 @@ main(argc, argv) char *cache_name = NULL; int code; int errflg=0; + int quiet = 0; krb5_init_ets(); if (strrchr(argv[0], '/')) argv[0] = strrchr(argv[0], '/')+1; - while ((c = getopt(argc, argv, "c:")) != EOF) { + while ((c = getopt(argc, argv, "qc:")) != EOF) { switch (c) { + case 'q': + quiet = 1; + break; case 'c': if (cache == NULL) { cache_name = optarg; @@ -83,7 +87,7 @@ main(argc, argv) errflg++; if (errflg) { - fprintf(stderr, "Usage: %s [ -c cache-name ]\n", argv[0]); + fprintf(stderr, "Usage: %s [-q] [ -c cache-name ]\n", argv[0]); exit(2); } @@ -97,11 +101,15 @@ main(argc, argv) code = krb5_cc_destroy (cache); if (code != 0) { com_err (argv[0], code, "while destroying cache"); + if (quiet) + fprintf(stderr, "Ticket cache NOT destroyed!\n"); + else { #ifdef __STDC__ - fprintf(stderr, "Ticket cache \aNOT\a destroyed!\n"); + fprintf(stderr, "Ticket cache \aNOT\a destroyed!\n"); #else - fprintf(stderr, "Ticket cache \007NOT\007 destroyed!\n"); + fprintf(stderr, "Ticket cache \007NOT\007 destroyed!\n"); #endif + } exit (1); } exit (0); -- 2.26.2