diff options
author | CNugteren <web@cedricnugteren.nl> | 2015-06-20 13:33:50 +0200 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2015-06-20 13:33:50 +0200 |
commit | 3ea3ba2beeab837e8d7c533746bd621daf1c09bd (patch) | |
tree | 8bce01e529f1ddca6a8af45b89a51f0e7f0935e6 /src/utilities.cc | |
parent | dfbc3365312a8ee1c100d7659e5814548192b48d (diff) |
Distinguish between a short smoke test and a full test
Diffstat (limited to 'src/utilities.cc')
-rw-r--r-- | src/utilities.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/utilities.cc b/src/utilities.cc index 3fc33502..98570088 100644 --- a/src/utilities.cc +++ b/src/utilities.cc @@ -159,16 +159,21 @@ Precision GetPrecision(const int argc, char *argv[]) { bool CheckArgument(const int argc, char *argv[], std::string &help, const std::string &option) { - // Updates the help message - help += " -"+option+"\n"; - // Parses the argument. Note that this supports both the given option (e.g. -device) and one with // an extra dash in front (e.g. --device). + auto return_value = false; for (int c=0; c<argc; ++c) { auto item = std::string{argv[c]}; - if (item.compare("-"+option) == 0 || item.compare("--"+option) == 0) { ++c; return true; } + if (item.compare("-"+option) == 0 || item.compare("--"+option) == 0) { + ++c; + return_value = true; + } } - return false; + + // Updates the help message and returns + help += " -"+option+" "; + help += (return_value) ? "[true]\n" : "[false]\n"; + return return_value; } // ================================================================================================= |