MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_cmd_search

Function db_cmd_search

freebsd/ddb/db_command.c:306–325  ·  view source on GitHub ↗

* Search for command prefix. */

Source from the content-addressed store, hash-verified

304 * Search for command prefix.
305 */
306static int
307db_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
327static void
328db_cmd_list(struct command_table *table)

Callers 1

db_commandFunction · 0.85

Calls 1

db_cmd_matchFunction · 0.85

Tested by

no test coverage detected