Tell the user what all the info or debug flags mean. */
| 482 | |
| 483 | /* Tell the user what all the info or debug flags mean. */ |
| 484 | static void output_item_help(struct output_struct *words) |
| 485 | { |
| 486 | short *levels = words == info_words ? info_levels : debug_levels; |
| 487 | const char *const*verbosity = words == info_words ? info_verbosity : debug_verbosity; |
| 488 | char buf[128], *opt, *fmt = "%-10s %s\n"; |
| 489 | int j; |
| 490 | |
| 491 | reset_output_levels(); |
| 492 | |
| 493 | rprintf(FINFO, "Use OPT or OPT1 for level 1 output, OPT2 for level 2, etc.; OPT0 silences.\n"); |
| 494 | rprintf(FINFO, "\n"); |
| 495 | for (j = 0; words[j].name; j++) |
| 496 | rprintf(FINFO, fmt, words[j].name, words[j].help); |
| 497 | rprintf(FINFO, "\n"); |
| 498 | |
| 499 | snprintf(buf, sizeof buf, "Set all %s options (e.g. all%d)", |
| 500 | words[j].help, MAX_OUT_LEVEL); |
| 501 | rprintf(FINFO, fmt, "ALL", buf); |
| 502 | |
| 503 | snprintf(buf, sizeof buf, "Silence all %s options (same as all0)", |
| 504 | words[j].help); |
| 505 | rprintf(FINFO, fmt, "NONE", buf); |
| 506 | |
| 507 | rprintf(FINFO, fmt, "HELP", "Output this help message"); |
| 508 | rprintf(FINFO, "\n"); |
| 509 | rprintf(FINFO, "Options added at each level of verbosity:\n"); |
| 510 | |
| 511 | for (j = 0; j <= MAX_VERBOSITY; j++) { |
| 512 | parse_output_words(words, levels, verbosity[j], HELP_PRIORITY); |
| 513 | opt = make_output_option(words, levels, W_CLI|W_SRV|W_SND|W_REC); |
| 514 | if (opt) { |
| 515 | rprintf(FINFO, "%d) %s\n", j, strchr(opt, '=')+1); |
| 516 | free(opt); |
| 517 | } |
| 518 | reset_output_levels(); |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | /* The --verbose option now sets info+debug flags. */ |
| 523 | static void set_output_verbosity(int level, uchar priority) |
no test coverage detected