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

Function DoCommand

tools/ngctl/main.c:506–519  ·  view source on GitHub ↗

* Execute the command */

Source from the content-addressed store, hash-verified

504 * Execute the command
505 */
506static int
507DoCommand(int ac, char **av)
508{
509 const struct ngcmd *cmd;
510 int rtn;
511
512 if (ac == 0 || *av[0] == 0)
513 return (CMDRTN_OK);
514 if ((cmd = FindCommand(av[0])) == NULL)
515 return (CMDRTN_ERROR);
516 if ((rtn = (*cmd->func)(ac, av)) == CMDRTN_USAGE)
517 warnx("usage: %s", cmd->cmd);
518 return (rtn);
519}
520
521/*
522 * Find a command

Callers 2

main.cFile · 0.85
DoParseCommandFunction · 0.85

Calls 1

FindCommandFunction · 0.85

Tested by

no test coverage detected