From 974c94fbb0604f139fad50e0bba47de26a80fcfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Fri, 13 Oct 2017 18:19:34 +0200 Subject: [PATCH] Unified version printing. --- app/include/plasp-app/Command.h | 6 ++++++ app/src/plasp-app/commands/CommandTranslate.cpp | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/include/plasp-app/Command.h b/app/include/plasp-app/Command.h index 57de926..ae4b014 100644 --- a/app/include/plasp-app/Command.h +++ b/app/include/plasp-app/Command.h @@ -6,6 +6,7 @@ #include #include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -55,6 +56,11 @@ class Command std::cout << m_options.help(optionGroupNames) << std::endl; } + void printVersion() + { + std::cout << Version << std::endl; + } + cxxopts::Options m_options; std::tuple m_optionGroups; }; diff --git a/app/src/plasp-app/commands/CommandTranslate.cpp b/app/src/plasp-app/commands/CommandTranslate.cpp index ec3b1c7..d4dcf7b 100644 --- a/app/src/plasp-app/commands/CommandTranslate.cpp +++ b/app/src/plasp-app/commands/CommandTranslate.cpp @@ -24,8 +24,6 @@ #include #include -#include - //////////////////////////////////////////////////////////////////////////////////////////////////// // // Command Translate @@ -55,7 +53,7 @@ int CommandTranslate::run(int argc, char **argv) if (basicOptions.version) { - std::cout << Version << std::endl; + printVersion(); return EXIT_SUCCESS; }