CLI command parsing utilities for processing command arguments.
More...
|
| void | tr_cli_parse_command (const tr_command_s *cmd_table, int argc, char **argv) |
| | Parses a command and executes the appropriate handler.
|
| uint8_t | tr_cli_get_option (int argc, char *argv[], char *opt_string, char **ret_arg) |
| | Gets an option from the command line arguments.
|
| uint64_t | tr_dec_or_hex_string_to_int (const char *number_string) |
| | Converts a decimal or hexadecimal string to an integer.
|
CLI command parsing utilities for processing command arguments.
◆ TR_ARGUMENT_PARSER_MAX_ARGS
| #define TR_ARGUMENT_PARSER_MAX_ARGS (15) |
Maximum number of arguments that can be parsed from a command line.
◆ tr_cli_get_option()
| uint8_t tr_cli_get_option |
( |
int | argc, |
|
|
char * | argv[], |
|
|
char * | opt_string, |
|
|
char ** | ret_arg ) |
Gets an option from the command line arguments.
- Parameters
-
| [in] | argc | Number of arguments in the command line. |
| [in] | argv | Array of argument strings. |
| [in] | opt_string | String containing the option characters to look for. |
| [out] | ret_arg | Pointer to store the option argument if found. |
- Returns
- 1 if the option was found, 0 otherwise.
◆ tr_cli_parse_command()
| void tr_cli_parse_command |
( |
const tr_command_s * | cmd_table, |
|
|
int | argc, |
|
|
char ** | argv ) |
Parses a command and executes the appropriate handler.
- Parameters
-
| [in] | cmd_table | Pointer to the command table containing available commands. |
| [in] | argc | Number of arguments in the command line. |
| [in] | argv | Array of argument strings. |
◆ tr_dec_or_hex_string_to_int()
| uint64_t tr_dec_or_hex_string_to_int |
( |
const char * | number_string | ) |
|
Converts a decimal or hexadecimal string to an integer.
- Parameters
-
| [in] | number_string | String containing the number to convert. |
- Returns
- The converted integer value.