Browse Source

Remove deprecated dependencyVersions

sendfile
Martchus 3 years ago
parent
commit
04a8ef02d5
  1. 5
      application/argumentparser.cpp
  2. 5
      application/argumentparser.h
  3. 2
      tests/argumentparsertests.cpp

5
application/argumentparser.cpp

@ -433,10 +433,7 @@ const char *applicationVersion = nullptr;
/// \brief Specifies the URL to the application website (used by ArgumentParser::printHelp()).
const char *applicationUrl = nullptr;
/// \brief Specifies the dependency versions the application was linked against (used by ArgumentParser::printHelp()).
/// \deprecated Not used anymore. Use dependencyVersions2 instead.
std::initializer_list<const char *> dependencyVersions;
/// \brief Specifies the dependency versions the application was linked against (used by ArgumentParser::printHelp()).
std::vector<const char *> dependencyVersions2;
std::vector<const char *> dependencyVersions;
// TODO v5 use a struct for these properties

5
application/argumentparser.h

@ -21,8 +21,7 @@ CPP_UTILITIES_EXPORT extern const char *applicationName;
CPP_UTILITIES_EXPORT extern const char *applicationAuthor;
CPP_UTILITIES_EXPORT extern const char *applicationVersion;
CPP_UTILITIES_EXPORT extern const char *applicationUrl;
CPP_UTILITIES_EXPORT extern std::initializer_list<const char *> dependencyVersions;
CPP_UTILITIES_EXPORT extern std::vector<const char *> dependencyVersions2;
CPP_UTILITIES_EXPORT extern std::vector<const char *> dependencyVersions;
/*!
* \def SET_DEPENDENCY_INFO
@ -30,7 +29,7 @@ CPP_UTILITIES_EXPORT extern std::vector<const char *> dependencyVersions2;
* used by ArgumentParser::printHelp().
* \remarks Reads those data from the config header so "config.h" must be included.
*/
#define SET_DEPENDENCY_INFO ::ApplicationUtilities::dependencyVersions2 = DEPENCENCY_VERSIONS
#define SET_DEPENDENCY_INFO ::ApplicationUtilities::dependencyVersions = DEPENCENCY_VERSIONS
/*!
* \def SET_APPLICATION_INFO

2
tests/argumentparsertests.cpp

@ -769,7 +769,7 @@ void ArgumentParserTests::testHelp()
envArg.appendValueName("file");
parser.helpArg().setRequired(true);
parser.setMainArguments({ &verboseArg, &filesArg, &envArg, &parser.noColorArg(), &parser.helpArg() });
dependencyVersions2 = { "somelib", "some other lib" };
dependencyVersions = { "somelib", "some other lib" };
// parse args and assert output
const char *const argv[] = { "app", "-h" };

Loading…
Cancel
Save