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
12
src/main.cpp
12
src/main.cpp
|
@ -2,6 +2,14 @@
|
||||||
#include "config/ConfigManager.hpp"
|
#include "config/ConfigManager.hpp"
|
||||||
#include "core/hyprlock.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) {
|
int main(int argc, char** argv, char** envp) {
|
||||||
std::string wlDisplay;
|
std::string wlDisplay;
|
||||||
|
|
||||||
|
@ -18,6 +26,10 @@ int main(int argc, char** argv, char** envp) {
|
||||||
wlDisplay = argv[i + 1];
|
wlDisplay = argv[i + 1];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
else if (arg == "--help" || arg == "-h") {
|
||||||
|
help();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue