From e6483d793245ee6a0faba895ee8c13c9aed75409 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 4 Sep 2025 22:47:40 +1000 Subject: internal: rename assets -> extras --- extras/version.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 extras/version.cpp (limited to 'extras/version.cpp') diff --git a/extras/version.cpp b/extras/version.cpp new file mode 100644 index 0000000..e1a0cf3 --- /dev/null +++ b/extras/version.cpp @@ -0,0 +1,26 @@ +#include + +int main(int argc, char* argv[]) { + if (argc > 1) { + std::string arg = argv[1]; + + if (arg == "-t" || arg == "--terse") { + std::cout << PROJECT_NAME << std::endl; + std::cout << VERSION << std::endl; + std::cout << GIT_REVISION << std::endl; + std::cout << DISTRIBUTOR << std::endl; + } else if (arg == "-s" || arg == "--short") { + std::cout << PROJECT_NAME << " " << VERSION << ", revision " << GIT_REVISION << ", distrubuted by: " << DISTRIBUTOR << std::endl; + } else { + std::cout << "Usage: " << argv[0] << " [-t | --terse] [-s | --short]" << std::endl; + return arg != "-h" && arg != "--help"; + } + } else { + std::cout << "Project: " << PROJECT_NAME << std::endl; + std::cout << "Version: " << VERSION << std::endl; + std::cout << "Git revision: " << GIT_REVISION << std::endl; + std::cout << "Distributor: " << DISTRIBUTOR << std::endl; + } + + return 0; +} -- cgit v1.2.3-freya