mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-06 00:35: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")
|
message(STATUS "Configuring XDPH in Release with CMake")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_compile_definitions(XDPH_VERSION="${VER}")
|
||||||
|
|
||||||
include_directories(. "protocols/")
|
include_directories(. "protocols/")
|
||||||
|
|
||||||
# configure
|
# configure
|
||||||
|
|
14
src/main.cpp
14
src/main.cpp
|
@ -4,11 +4,12 @@
|
||||||
#include "core/PortalManager.hpp"
|
#include "core/PortalManager.hpp"
|
||||||
|
|
||||||
void printHelp() {
|
void printHelp() {
|
||||||
std::cout << R"#(| xdg-desktop-portal-hyprland
|
std::cout << R"#(┃ xdg-desktop-portal-hyprland
|
||||||
| --------------------------------------
|
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
| -v (--verbose) > enable trace logging
|
┃ -v (--verbose) → enable trace logging
|
||||||
| -q (--quiet) > disable logging
|
┃ -q (--quiet) → disable logging
|
||||||
| -h (--help) > print this menu
|
┃ -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") {
|
else if (arg == "--help" || arg == "-h") {
|
||||||
printHelp();
|
printHelp();
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (arg == "--version" || arg == "-V") {
|
||||||
|
std::cout << "xdg-desktop-portal-hyprland v" << XDPH_VERSION << "\n";
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
printHelp();
|
printHelp();
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue