Go to the documentation of this file.
5 #include "../include/utils/colors.h"
6 #include "../include/utils/command_line.h"
7 #include "../include/utils/safe_mem.h"
8 #include "../include/utils/logger.h"
11 #ifndef COMMAND_VERSION_STRING
12 #define COMMAND_VERSION_STRING "0.0.1"
18 int main(
int argc,
char *argv[]) {
21 int response =
parse_args(argc, argv, argtable);
26 printf(
"parse_args failed\n");
39 printf(
"failed to get command_object");
43 int resp =
execute(pcmd,
"helo");
49 arg_freetable(argtable,
sizeof(argtable) /
sizeof(argtable[0]));
struct arg_str * command_to_run
void print_help(char *program_name, void *argtable[])
formats output
int parse_args(int argc, char *argv[], void *argtable[])
parses arguments, and checks for any errors
void free_command_object(command_object *self)
frees memory allocated for the command_object and sets pointer to null for some reason this is causin...
void setup_args(const char *version_string)
setups the default argtable arguments
int execute(command_object *self, char *run)
checks to see if we have a command named according to run and executes it
command_handler * new_help_command(command_object *self)
#define COMMAND_VERSION_STRING
command_object * new_command_object(int argc, char *argv[])
intializes a new command_object to have commands loaded into
int main(int argc, char *argv[])