From a279ee7613bdb2ff3b2081d6e11526545ed5c142 Mon Sep 17 00:00:00 2001 From: LOSEARDES77 <84414230+LOSEARDES77@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:10:15 +0100 Subject: [PATCH] core: add help message (#88) * core: add help message * core: create help method * remove short option for display arg * fix alignment --- src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b6c6dc3..2a5c01e 100644 --- a/src/main.cpp +++ b/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; -} \ No newline at end of file +}