* Search for command prefix. */
| 304 | * Search for command prefix. |
| 305 | */ |
| 306 | static int |
| 307 | db_cmd_search(char *name, struct command_table *table, struct command **cmdp) |
| 308 | { |
| 309 | struct command *cmd; |
| 310 | int result = CMD_NONE; |
| 311 | |
| 312 | LIST_FOREACH(cmd, table, next) { |
| 313 | db_cmd_match(name,cmd,cmdp,&result); |
| 314 | if (result == CMD_UNIQUE) |
| 315 | break; |
| 316 | } |
| 317 | |
| 318 | if (result == CMD_NONE) { |
| 319 | /* check for 'help' */ |
| 320 | if (name[0] == 'h' && name[1] == 'e' |
| 321 | && name[2] == 'l' && name[3] == 'p') |
| 322 | result = CMD_HELP; |
| 323 | } |
| 324 | return (result); |
| 325 | } |
| 326 | |
| 327 | static void |
| 328 | db_cmd_list(struct command_table *table) |
no test coverage detected