Go to the documentation of this file.
14 #include <argtable3.h>
18 #define MAX_COMMANDS 32
21 #ifndef MAX_COMMAND_ARGS
22 #define MAX_COMMAND_ARGS 32
63 void print_help(
char *program_name,
void *argtable[]);
66 int parse_args(
int argc,
char *argv[],
void *argtable[]);
struct arg_str * command_to_run
void free_command_object(command_object *self)
frees memory allocated for the command_object and sets pointer to null
command_handler * commands[32]
void setup_args(const char *version_string)
setups the default argtable arguments
struct command command_object
int execute(command_object *self, char *command_to_run)
checks to see if we have a command named according to run and executes it
command_handler_callback callback
command_object * new_command_object(int argc, char *argv[])
intializes a new command_object to have commands loaded into
void(* command_handler_callback)(int argc, char *argv[])
char * get_run_command()
returns the value of command_to_run
int parse_args(int argc, char *argv[], void *argtable[])
parses arguments, and checks for any errors
int load_command(command_object *self, command_handler *command)
loads command handler and makes it executable
void print_help(char *program_name, void *argtable[])
formats output