mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-21 22:25:58 +01:00
core: add --version and improve --help
This commit is contained in:
parent
a8ebdcb011
commit
15932f0f9e
2 changed files with 11 additions and 5 deletions
|
@ -21,6 +21,8 @@ else()
|
|||
message(STATUS "Configuring XDPH in Release with CMake")
|
||||
endif()
|
||||
|
||||
add_compile_definitions(XDPH_VERSION="${VER}")
|
||||
|
||||
include_directories(. "protocols/")
|
||||
|
||||
# configure
|
||||
|
|
14
src/main.cpp
14
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;
|
||||
|
|
Loading…
Reference in a new issue