diff --git a/cmdMa.cpp b/cmdMa.cpp index 4b79dea3..bc1d4609 100644 --- a/cmdMa.cpp +++ b/cmdMa.cpp @@ -394,6 +394,11 @@ int main( int argc, char* argv[] ) generateHelpMessage( xExecutionContext.xParameterSetManager ); return 0; } // if + if( xExecutionContext.xParameterSetManager.pGeneralParameterSet->pbPrintVerstion->get( ) ) + { + std::cout << MA_VERSION << std::endl; + return 0; + } // if std::pair xPreviousProgress = std::make_pair( -1, 0 ); std::cout << "starting alignment." << std::endl; diff --git a/libs/ms/CMakeLists.txt b/libs/ms/CMakeLists.txt index b01aa354..c4a2a075 100644 --- a/libs/ms/CMakeLists.txt +++ b/libs/ms/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.8) -project("MS Lib" VERSION 2.0.0 DESCRIPTION "Modular Structure library") +project("MS Lib" VERSION 2.0.1 DESCRIPTION "Modular Structure library") if( PythonLibs_FOUND ) @@ -199,10 +199,10 @@ endif() if(NOT RESULT_COMMIT STREQUAL "0" OR NOT RESULT_STATUS STREQUAL "0") message( "--libMS: WARNING cannot infer version from git (maybe git.exe is not in your environment path?)" ) - set(MS_VERSION "Unknown") + set(MA_VERSION "Unknown") else() - set(MS_VERSION "${PROJECT_VERSION}-${GIT_COMMIT_HASH}${GIT_STATUS}") - message( "--libMS: Version = ${MS_VERSION}" ) + set(MA_VERSION "${PROJECT_VERSION}-${GIT_COMMIT_HASH}${GIT_STATUS}") + message( "--libMS: Version = ${MA_VERSION}" ) endif() configure_file( # @todo so far this only triggers during configure not at build time diff --git a/libs/ms/inc/ms/util/parameter.h b/libs/ms/inc/ms/util/parameter.h index 648c8283..340e9872 100644 --- a/libs/ms/inc/ms/util/parameter.h +++ b/libs/ms/inc/ms/util/parameter.h @@ -951,6 +951,7 @@ class GeneralParameter : public ParameterSetBase AlignerParameterPointer pbUseMaxHardareConcurrency; // Exploit all cores AlignerParameterPointer piNumberOfThreads; // selected number of threads AlignerParameterPointer pbPrintHelpMessage; // Print the help message to stdout + AlignerParameterPointer pbPrintVerstion; // Print the version to stdout /* Constructor */ GeneralParameter( ) @@ -972,7 +973,8 @@ class GeneralParameter : public ParameterSetBase "Number of threads used in the context of alignments. This options is only available, if " "'use all processor cores' is off.", GENERAL_PARAMETER, 1, checkPositiveValue ), - pbPrintHelpMessage( this, "Help", 'h', "Print the complete help text.", GENERAL_PARAMETER, false ) + pbPrintHelpMessage( this, "Help", 'h', "Print the complete help text.", GENERAL_PARAMETER, false ), + pbPrintVerstion( this, "Version", 'v', "Print the version and exit.", GENERAL_PARAMETER, false ) { xSAMOutputPath->fEnabled = [ this ]( void ) { return this->xSAMOutputTypeChoice->uiSelection == 1; }; xSAMOutputFileName->fEnabled = [ this ]( void ) { return this->xSAMOutputTypeChoice->uiSelection == 2; };