format extended command flags for display */
| 521 | |
| 522 | /* format extended command flags for display */ |
| 523 | staticfn char * |
| 524 | doc_extcmd_flagstr( |
| 525 | winid menuwin, |
| 526 | const struct ext_func_tab *efp) /* if Null, add a footnote to the menu */ |
| 527 | { |
| 528 | static char Abuf[10]; /* 5 would suffice: {'[','m','A',']','\0'} */ |
| 529 | |
| 530 | /* note: tag shown for menu prefix is 'm' even if m-prefix action |
| 531 | has been bound to some other key */ |
| 532 | if (!efp) { |
| 533 | char qbuf[QBUFSZ]; |
| 534 | |
| 535 | add_menu_str(menuwin, "[A] Command autocompletes"); |
| 536 | Sprintf(qbuf, "[m] Command accepts '%s' prefix", |
| 537 | visctrl(cmd_from_func(do_reqmenu))); |
| 538 | add_menu_str(menuwin, qbuf); |
| 539 | return (char *) 0; |
| 540 | } else { |
| 541 | boolean mprefix = accept_menu_prefix(efp), |
| 542 | autocomplete = (efp->flags & AUTOCOMPLETE) != 0; |
| 543 | char *p = Abuf; |
| 544 | |
| 545 | /* "" or "[m]" or "[A]" or "[mA]" */ |
| 546 | if (mprefix || autocomplete) { |
| 547 | *p++ = '['; |
| 548 | if (mprefix) |
| 549 | *p++ = 'm'; |
| 550 | if (autocomplete) |
| 551 | *p++ = 'A'; |
| 552 | *p++ = ']'; |
| 553 | } |
| 554 | *p = '\0'; |
| 555 | return Abuf; |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | /* here after #? - now list all full-word commands and provide |
| 560 | some navigation capability through the long list */ |
no test coverage detected