struct command {
const char* verb;
+ int (*callback)(void* config, int argc, char* argv[]);
enum {
CLI_REQUIRE_ONE_ARGUMENT = (1 << 0),
CLI_REQUIRE_ONE_OR_MORE_ARGUMENTS = (1 << 1),
} flags;
- int (*callback)(void* config, int argc, char* argv[]);
};
int cli_parse(const struct argp_option* options, const struct command* commands,
};
static const struct command commands[] = {
- { "build", CLI_REQUIRE_ONE_OR_MORE_ARGUMENTS, cli_build },
- { "clean", 0, cli_clean },
+ { "build", cli_build, 0 },
+ { "clean", cli_clean, 0 },
#if 0
{ "dist", 0, cli_dist },
{ "image", 0, cli_image },