diff options
author | charnier <charnier@FreeBSD.org> | 1997-07-15 09:50:59 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-07-15 09:50:59 +0000 |
commit | bc62cc22d428b8bf365811ff033a3696292c0300 (patch) | |
tree | 7b10c0aea4854d3f1d7ff46e9bef9b304129a472 /usr.bin/indent/args.c | |
parent | 793ad1484d5d406c30d3f2b2cd3a648dec3bbe02 (diff) | |
download | FreeBSD-src-bc62cc22d428b8bf365811ff033a3696292c0300.zip FreeBSD-src-bc62cc22d428b8bf365811ff033a3696292c0300.tar.gz |
Use err(3) instead of local redefinition. Add usage().
Diffstat (limited to 'usr.bin/indent/args.c')
-rw-r--r-- | usr.bin/indent/args.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c index e62f038..376a603 100644 --- a/usr.bin/indent/args.c +++ b/usr.bin/indent/args.c @@ -34,7 +34,11 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)args.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -42,8 +46,9 @@ static char sccsid[] = "@(#)args.c 8.1 (Berkeley) 6/6/93"; * here as well. */ -#include <stdio.h> #include <ctype.h> +#include <err.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include "indent_globs.h" @@ -230,8 +235,7 @@ set_option(arg) for (p = pro; p->p_name; p++) if (*p->p_name == *arg && eqin(p->p_name, arg)) goto found; - fprintf(stderr, "indent: %s: unknown parameter \"%s\"\n", option_source, arg - 1); - exit(1); + errx(1, "%s: unknown parameter \"%s\"", option_source, arg - 1); found: switch (p->p_type) { @@ -265,9 +269,7 @@ found: break; default: - fprintf(stderr, "\ -indent: set_option: internal error: p_special %d\n", p->p_special); - exit(1); + errx(1, "set_option: internal error: p_special %d", p->p_special); } break; @@ -281,9 +283,7 @@ indent: set_option: internal error: p_special %d\n", p->p_special); case PRO_INT: if (!isdigit(*param_start)) { need_param: - fprintf(stderr, "indent: %s: ``%s'' requires a parameter\n", - option_source, arg - 1); - exit(1); + errx(1, "%s: ``%s'' requires a parameter", option_source, arg - 1); } *p->p_obj = atoi(param_start); break; @@ -293,8 +293,6 @@ indent: set_option: internal error: p_special %d\n", p->p_special); break; default: - fprintf(stderr, "indent: set_option: internal error: p_type %d\n", - p->p_type); - exit(1); + errx(1, "set_option: internal error: p_type %d", p->p_type); } } |