core: add help message (#88)

* core: add help message

* core: create help method

* remove short option for display arg

* fix alignment
This commit is contained in:
LOSEARDES77 2024-02-27 16:10:15 +01:00 committed by GitHub
parent 2c7027d2b5
commit a279ee7613
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,14 @@
#include "config/ConfigManager.hpp"
#include "core/hyprlock.hpp"
void help(){
std::cout << "Usage: hyprlock [options]\n\n"
"Options:\n"
" -v, --verbose - Enable verbose logging\n"
" -q, --quiet - Disable logging\n"
" --display (display) - Specify the Wayland display to connect to\n"
" -h, --help - Show this help message\n";
}
int main(int argc, char** argv, char** envp) {
std::string wlDisplay;
@ -18,6 +26,10 @@ int main(int argc, char** argv, char** envp) {
wlDisplay = argv[i + 1];
i++;
}
else if (arg == "--help" || arg == "-h") {
help();
return 0;
}
}
try {
@ -35,4 +47,4 @@ int main(int argc, char** argv, char** envp) {
g_pHyprlock->run();
return 0;
}
}