diff --git a/include/aws/common/command_line_parser.h b/include/aws/common/command_line_parser.h index 0f7523c8a..2a2207b8f 100644 --- a/include/aws/common/command_line_parser.h +++ b/include/aws/common/command_line_parser.h @@ -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 const 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 diff --git a/source/command_line_parser.c b/source/command_line_parser.c index 0699e7fbb..ed6100836 100644 --- a/source/command_line_parser.c +++ b/source/command_line_parser.c @@ -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,