From 8750e385f179bc581cecde3b03c8db2c539a8fbb Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 29 Sep 2017 17:15:39 +0200 Subject: [PATCH] Improve doc for ArgumentParser::parseArgs()/readArgs() --- application/argumentparser.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index 5de11a4..7dbce7b 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -671,9 +671,11 @@ void ArgumentParser::printHelp(ostream &os) const * \remarks * - The results are stored in the Argument instances assigned as main arguments and sub arguments. * - Calls the assigned callbacks if no constraints are violated. + * - This method will not return in case shell completion is requested. This behavior can be altered + * by overriding ApplicationUtilities::exitFunction which defaults to &std::exit. * \throws Throws Failure if the specified arguments are invalid or violate the constraints defined * by the Argument instances. - * \sa readArgs() + * \sa readArgs(), parseArgsOrExit() */ void ArgumentParser::parseArgs(int argc, const char *const *argv) { @@ -708,8 +710,10 @@ void ArgumentParser::parseArgsOrExit(int argc, const char *const *argv) * - The results are stored in the Argument instances assigned as main arguments and sub arguments. * - In contrast to parseArgs() this method does not check whether constraints are violated and it * does not call any callbacks. + * - This method will not return in case shell completion is requested. This behavior can be altered + * by overriding ApplicationUtilities::exitFunction which defaults to &std::exit. * \throws Throws Failure if the specified arguments are invalid. - * \sa readArgs() + * \sa parseArgs(), parseArgsOrExit() */ void ArgumentParser::readArgs(int argc, const char *const *argv) { @@ -721,7 +725,7 @@ void ArgumentParser::readArgs(int argc, const char *const *argv) // check for further arguments if (--argc) { - // if the first argument (after executable name) is "--bash-completion-for" bash completion for the following arguments is requested + // if the first argument (after executable name) is "--bash-completion-for", bash completion for the following arguments is requested bool completionMode = !strcmp(*++argv, "--bash-completion-for"); unsigned int currentWordIndex; if (completionMode) {