| 9459 | }; |
| 9460 | |
| 9461 | void |
| 9462 | option_help(void) |
| 9463 | { |
| 9464 | char buf[BUFSZ], buf2[BUFSZ]; |
| 9465 | const char *optname; |
| 9466 | int i; |
| 9467 | winid datawin; |
| 9468 | |
| 9469 | datawin = create_nhwindow(NHW_TEXT); |
| 9470 | Snprintf(buf, sizeof buf, |
| 9471 | "Set options as OPTIONS=<options> in %s", get_configfile()); |
| 9472 | opt_intro[CONFIG_SLOT] = (const char *) buf; |
| 9473 | for (i = 0; opt_intro[i]; i++) |
| 9474 | putstr(datawin, 0, opt_intro[i]); |
| 9475 | |
| 9476 | /* Boolean options */ |
| 9477 | for (i = 0; allopt[i].name; i++) { |
| 9478 | if ((allopt[i].opttyp != BoolOpt || !allopt[i].addr) |
| 9479 | || (allopt[i].setwhere == set_wizonly && !wizard)) |
| 9480 | continue; |
| 9481 | if (allopt[i].setwhere == set_wiznofuz |
| 9482 | && (!wizard || iflags.debug_fuzzer)) |
| 9483 | continue; |
| 9484 | optname = allopt[i].name; |
| 9485 | if ((is_wc_option(optname) && !wc_supported(optname)) |
| 9486 | || (is_wc2_option(optname) && !wc2_supported(optname))) |
| 9487 | continue; |
| 9488 | next_opt(datawin, optname); |
| 9489 | } |
| 9490 | next_opt(datawin, ""); |
| 9491 | |
| 9492 | /* Compound options */ |
| 9493 | putstr(datawin, 0, "Compound options:"); |
| 9494 | for (i = 0; allopt[i].name; i++) { |
| 9495 | if (allopt[i].opttyp != CompOpt |
| 9496 | || (allopt[i].setwhere == set_wizonly && !wizard)) |
| 9497 | continue; |
| 9498 | if (allopt[i].setwhere == set_wiznofuz |
| 9499 | && (!wizard || iflags.debug_fuzzer)) |
| 9500 | continue; |
| 9501 | optname = allopt[i].name; |
| 9502 | if ((is_wc_option(optname) && !wc_supported(optname)) |
| 9503 | || (is_wc2_option(optname) && !wc2_supported(optname))) |
| 9504 | continue; |
| 9505 | Sprintf(buf2, "`%s'", optname); |
| 9506 | Snprintf(buf, sizeof(buf), "%-20s - %s%c", buf2, allopt[i].descr, |
| 9507 | allopt[i + 1].name ? ',' : '.'); |
| 9508 | putstr(datawin, 0, buf); |
| 9509 | } |
| 9510 | putstr(datawin, 0, ""); |
| 9511 | |
| 9512 | /* Compound options */ |
| 9513 | putstr(datawin, 0, "Other settings:"); |
| 9514 | for (i = 0; allopt[i].name; i++) { |
| 9515 | if (allopt[i].opttyp != OthrOpt) |
| 9516 | continue; |
| 9517 | Sprintf(buf, " %s", allopt[i].name); |
| 9518 | putstr(datawin, 0, buf); |
no test coverage detected