* Implement extended command completion by using this hook into * tty_getlin. Check the characters already typed, if they uniquely * identify an extended command, expand the string to the whole * command. * * Return TRUE if we've extended the string at base. Otherwise return FALSE. * Assumptions: * * + we don't change the characters that are already in base * + base has enough
| 269 | * + base has enough room to hold our string |
| 270 | */ |
| 271 | static boolean |
| 272 | ext_cmd_getlin_hook(char *base) |
| 273 | { |
| 274 | int *ecmatches; |
| 275 | int nmatches = extcmds_match(base, ECM_NOFLAGS, &ecmatches); |
| 276 | |
| 277 | if (nmatches == 1) { |
| 278 | struct ext_func_tab *ec = extcmds_getentry(ecmatches[0]); |
| 279 | |
| 280 | Strcpy(base, ec->ef_txt); |
| 281 | return TRUE; |
| 282 | } |
| 283 | |
| 284 | return FALSE; /* didn't match anything */ |
| 285 | } |
| 286 | |
| 287 | /* |
| 288 | * Read in an extended command, doing command line completion. We |
nothing calls this directly
no test coverage detected