34 lines
740 B
C
34 lines
740 B
C
#ifndef CLI_H
|
|
#define CLI_H
|
|
|
|
/*
|
|
* Result structure containing command status and message
|
|
*/
|
|
typedef struct {
|
|
int success; // 0 for failure, 1 for success
|
|
char *message; // Result or error message
|
|
} cli_result_t;
|
|
|
|
/*
|
|
* cli_print_help - Prints the cli's usage text to stdout.
|
|
*/
|
|
void cli_print_help(void);
|
|
|
|
/*
|
|
* cli_execute - Parse arguments and execute the command
|
|
* @argc: Argument count
|
|
* @argv: Argument array
|
|
*
|
|
* Returns: cli_result_t with status and message.
|
|
* Caller must free message with string_free().
|
|
*/
|
|
cli_result_t cli_execute(int argc, char *argv[]);
|
|
|
|
/*
|
|
* cli_print_result - Print a result to stdout
|
|
* @result: Result structure from cli_execute
|
|
*/
|
|
void cli_print_result(const cli_result_t *result);
|
|
|
|
#endif
|