diff --git a/winixd/main/main.cpp b/winixd/main/main.cpp index 979d892..76b8770 100644 --- a/winixd/main/main.cpp +++ b/winixd/main/main.cpp @@ -44,7 +44,8 @@ #include "core/version.h" #include "utf8/utf8.h" #include "mainoptions/mainoptionsparser.h" - +#include "pikotools/version.h" +#include "tito.h" @@ -60,9 +61,22 @@ App app; +void print_version() +{ + std::cout << "Winix " << WINIX_VER_MAJOR << '.' << WINIX_VER_MINOR << '.' << WINIX_VER_REVISION << std::endl; + std::cout << "Copyright (c) 2008-2022, Tomasz Sowa" << std::endl; + std::cout << std::endl; + std::cout << "Components: " << std::endl; + std::cout << " pikotools: " << PIKOTOOLS_VERSION_MAJOR << '.' << PIKOTOOLS_VERSION_MINOR << '.' << PIKOTOOLS_VERSION_PATCH << std::endl; + std::cout << " morm: " << MORM_VERSION_MAJOR << '.' << MORM_VERSION_MINOR << '.' << MORM_VERSION_PATCH << std::endl; + std::cout << " ezc: " << EZC_VERSION_MAJOR << '.' << EZC_VERSION_MINOR << '.' << EZC_VERSION_PATCH << std::endl; + std::cout << " tito: " << TITO_VERSION_MAJOR << '.' << TITO_VERSION_MINOR << '.' << TITO_VERSION_PATCH << std::endl; +} + + void print_syntax() { - std::cout << "Winix version " << WINIX_VER_MAJOR << '.' << WINIX_VER_MINOR << '.' << WINIX_VER_REVISION << std::endl; + std::cout << "Winix " << WINIX_VER_MAJOR << '.' << WINIX_VER_MINOR << '.' << WINIX_VER_REVISION << std::endl; std::cout << "Copyright (c) 2008-2022, Tomasz Sowa" << std::endl; std::cout << "Usage: winix [options]" << std::endl; @@ -73,6 +87,8 @@ void print_syntax() std::cout << " -h : print usage information" << std::endl; std::cout << " --help : print usage information" << std::endl; std::cout << " -? : print usage information" << std::endl; + std::cout << " -v : print version" << std::endl; + std::cout << " --version : print version" << std::endl; std::cout << std::endl; std::cout << "At least one -c or --config parameter is required, use -c or --config option" << std::endl; std::cout << "multiple times to load more than one config." << std::endl; @@ -294,6 +310,12 @@ using Winix::app; return 0; } + if( options.has_key(L"v") || options.has_key(L"version") ) + { + Winix::print_version(); + return 0; + } + Winix::Log & log = app.GetMainLog(); pt::WTextStream * log_buffer = log.get_log_buffer(); Winix::LogInfo(log, Winix::log3, "UTC booting Winix", true, ""); // date will be printed as UTC because the time zones are not loaded yet