From 414d4de46b80fed8c630a95f617cf3fb87fc0d6a Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 22 Oct 2016 16:49:12 +0200 Subject: [PATCH] Fixed: Return an error when a required argument is missing --HG-- branch : develop --- code/nel/src/misc/cmd_args.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc/cmd_args.cpp b/code/nel/src/misc/cmd_args.cpp index 6ec3fd485..e6211faaf 100644 --- a/code/nel/src/misc/cmd_args.cpp +++ b/code/nel/src/misc/cmd_args.cpp @@ -141,7 +141,7 @@ bool CCmdArgs::needAdditionalArg() const const TArg &arg = _Args[i]; // they don't have any short or long name, but need a name in help - if (arg.shortName.empty() && arg.longName.empty() && !arg.helpName.empty() && arg.required) + if (arg.shortName.empty() && arg.longName.empty() && !arg.helpName.empty() && arg.required && !arg.found) return true; } @@ -363,7 +363,7 @@ bool CCmdArgs::parse(const std::vector &argv) } // process help if requested or if required arguments are missing - if (haveLongArg("help") || (needAdditionalArg() && !haveAdditionalArg())) + if (haveLongArg("help") || needAdditionalArg()) { displayHelp(); return false;