* Execute the command */
| 504 | * Execute the command |
| 505 | */ |
| 506 | static int |
| 507 | DoCommand(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 |
no test coverage detected