From acfa601c8005388f0c472d72c8aec7e6d6e0ffe0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 14 Nov 2021 02:36:59 +0100 Subject: [PATCH] Properly process the last main arg in arg parser. --- core/os/arg_parser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/os/arg_parser.cpp b/core/os/arg_parser.cpp index 62d262d..f270434 100644 --- a/core/os/arg_parser.cpp +++ b/core/os/arg_parser.cpp @@ -27,7 +27,6 @@ void ArgParser::parse_args(int argc, char **argv, int executable_index) { post_process_args(); } void ArgParser::parse_env(char **envp) { - } void ArgParser::post_process_args() { @@ -57,12 +56,16 @@ void ArgParser::post_process_args() { } } } + + if (main_arg) { + arguments_set.insert(arg_main_command); + } } bool ArgParser::has_arg(const String &arg) const { std::set::iterator search = arguments_set.find(arg); - return (search != arguments_set.end()); + return (search != arguments_set.end()); } String *ArgParser::get_value(const String &arg) {