Unified version printing.

This commit is contained in:
Patrick Lühne 2017-10-13 18:19:34 +02:00
parent 2be3f4256a
commit 974c94fbb0
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
2 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,7 @@
#include <cxxopts.hpp> #include <cxxopts.hpp>
#include <plasp-app/Utils.h> #include <plasp-app/Utils.h>
#include <plasp-app/Version.h>
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// //
@ -55,6 +56,11 @@ class Command
std::cout << m_options.help(optionGroupNames) << std::endl; std::cout << m_options.help(optionGroupNames) << std::endl;
} }
void printVersion()
{
std::cout << Version << std::endl;
}
cxxopts::Options m_options; cxxopts::Options m_options;
std::tuple<OptionGroups...> m_optionGroups; std::tuple<OptionGroups...> m_optionGroups;
}; };

View File

@ -24,8 +24,6 @@
#include <plasp/sas/Description.h> #include <plasp/sas/Description.h>
#include <plasp/sas/TranslatorASP.h> #include <plasp/sas/TranslatorASP.h>
#include <plasp-app/Version.h>
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Command Translate // Command Translate
@ -55,7 +53,7 @@ int CommandTranslate::run(int argc, char **argv)
if (basicOptions.version) if (basicOptions.version)
{ {
std::cout << Version << std::endl; printVersion();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }