1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-15 09:57:12 +01:00
pkg-utils/main/pkg.c
David Oberhollenzer 6ec11b532e Initial commit
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2019-01-26 23:19:21 +01:00

21 lines
334 B
C

#include <stdlib.h>
#include <stdio.h>
#include "command.h"
int main(int argc, char **argv)
{
command_t *cmd;
if (argc < 2)
usage(EXIT_SUCCESS);
cmd = command_by_name(argv[1]);
if (cmd == NULL) {
fprintf(stderr, "Unknown command '%s'\n\n", argv[1]);
usage(EXIT_FAILURE);
}
return cmd->run_cmd(argc - 1, argv + 1);
}