- if (!optarg) {
- bc__banner(stdout);
- bc__write(stdout,
- "\n"
- "Tracing options:\n"
- "\n");
- for (tp = lvltbl; tp->l; tp++) {
- if ((flags & f_setuid) == 0 || tp->l & ~TRACE_PRIV)
- printf("%c -- %s\n", tp->ch, tp->help);
- }
- bc__write(stdout,
-"\n"
-"Also, `+' and `-' options are recognised to turn on and off various\n"
-"tracing options. For example, `A-r' enables everything except ruleset\n"
-"tracing, and `A-D+c' is everything except the defaults, but with request\n"
-"check tracing.\n"
-);
- exit(0);
- }
-
- while (*p) {
- if (*p == '+')
- sense = 1;
- else if (*p == '-')
- sense = 0;
- else {
- for (tp = lvltbl; tp->l && *p != tp->ch; tp++)
- ;
- l = tp->l;
- if (flags & f_setuid)
- l &= ~TRACE_PRIV;
- if (l)
- lvl = sense ? (lvl | l) : (lvl & ~l);
- else
- moan("unknown trace option `%c'", *p);
- }
- p++;
- }
-
- tracesetlvl(lvl);
- yydebug = ((lvl & TRACE_YACC) != 0);
+ trace_level(traceopt(lvltbl, optarg, TRACE_DFL,
+ (flags & f_setuid) ? TRACE_PRIV : 0));