mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
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:
parent
2c7027d2b5
commit
a279ee7613
1 changed files with 13 additions and 1 deletions
14
src/main.cpp
14
src/main.cpp
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue