diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f194f7..66773db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,8 @@ else() message(STATUS "Configuring XDPH in Release with CMake") endif() +add_compile_definitions(XDPH_VERSION="${VER}") + include_directories(. "protocols/") # configure diff --git a/src/main.cpp b/src/main.cpp index d7a4482..cdeb83d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,11 +4,12 @@ #include "core/PortalManager.hpp" void printHelp() { - std::cout << R"#(| xdg-desktop-portal-hyprland -| -------------------------------------- -| -v (--verbose) > enable trace logging -| -q (--quiet) > disable logging -| -h (--help) > print this menu + std::cout << R"#(┃ xdg-desktop-portal-hyprland +┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +┃ -v (--verbose) → enable trace logging +┃ -q (--quiet) → disable logging +┃ -h (--help) → print this menu +┃ -V (--version) → print xdph's version )#"; } @@ -27,6 +28,9 @@ int main(int argc, char** argv, char** envp) { else if (arg == "--help" || arg == "-h") { printHelp(); return 0; + } else if (arg == "--version" || arg == "-V") { + std::cout << "xdg-desktop-portal-hyprland v" << XDPH_VERSION << "\n"; + return 0; } else { printHelp(); return 1;