|
CNDP 22.08.0
|
#include <stdio.h>#include <stdint.h>#include <stdlib.h>#include <string.h>#include <stdarg.h>#include <unistd.h>#include <inttypes.h>#include <sys/queue.h>#include "cli_map.h"#include "cne_common.h"Go to the source code of this file.
Functions | |
| CNDP_API struct help_node * | cli_help_find_group (const char *group) |
| CNDP_API int | cli_help_show_all (const char *msg) |
| CNDP_API int | cli_help_show_group (const char *group) |
| CNDP_API int | cli_help_add (const char *group, struct cli_map *map, const char **hd) |
| static int | is_help (int argc, char **argv) |
| CNDP_API void | cli_help_foreach (void(*func)(void *arg, const char **h), void *arg) |
| CNDP_API int | cli_cmd_error (const char *msg, const char *group, int argc, char **argv) |
CNE Command line interface
Definition in file cli_help.h.
| CNDP_API struct help_node * cli_help_find_group | ( | const char * | group | ) |
Find the help group section defined by the group string.
| group | The group string name to find. |
| CNDP_API int cli_help_show_all | ( | const char * | msg | ) |
Show the map table entries
| msg | Pointer to a message to print first. |
| CNDP_API int cli_help_show_group | ( | const char * | group | ) |
Show the help message for the user.
| group | Pointer to the cli_info structure. |
| CNDP_API int cli_help_add | ( | const char * | group, |
| struct cli_map * | map, | ||
| const char ** | hd ) |
Add help string group to a help structure
| group | The group name for this help list |
| map | The pointer to the MAP structure if present. |
| hd | The array of string pointers for the help group |
|
inlinestatic |
Find if the last item is a help request.
| argc | Number of args in the argv list. |
| argv | List of strings to parser |
Definition at line 100 of file cli_help.h.
| CNDP_API void cli_help_foreach | ( | void(* | func )(void *arg, const char **h), |
| void * | arg ) |
Iterate over the help messages calling a given function.
| func | A function to call for all help lines. |
| arg | Argument pointer for function call. |
| CNDP_API int cli_cmd_error | ( | const char * | msg, |
| const char * | group, | ||
| int | argc, | ||
| char ** | argv ) |
Process a CLI command error
| msg | The message to display on error |
| group | The group string for this command |
| argc | Number or arguments in the argv array |
| argv | The array of string pointers for the command line. |