Skip to content

Commit

Permalink
add a helper
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Jan 6, 2025
1 parent 7a6f5df commit 7bae400
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/aws/common/command_line_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ AWS_COMMON_API int aws_cli_getopt_long(
*/
AWS_COMMON_API void aws_cli_reset_state(void);

/*
* Returns the aws_cli_optarg variable
*/
AWS_COMMON_API char *aws_get_cli_optarg(void);

/**
* Dispatches the current command line arguments with a subcommand from the second input argument in argv[], if
* dispatch table contains a command that matches the argument. When the command is dispatched, argc and argv will be
Expand Down
4 changes: 4 additions & 0 deletions source/command_line_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ bool aws_cli_on_arg = false;
const char *aws_cli_optarg = NULL;
const char *aws_cli_positional_arg = NULL;

const char *aws_get_cli_optarg(void) {
return aws_cli_optarg;
}

static const struct aws_cli_option *s_find_option_from_char(
const struct aws_cli_option *longopts,
char search_for,
Expand Down

0 comments on commit 7bae400

Please sign in to comment.