diff options
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); } } |