summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-10 18:26:36 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-10 18:26:36 +0100
commitfa4aef4531d3ca138cc0c5a87768358fd5d7df7d (patch)
tree7e69c9a8a3e92dc2412aa9f31ea3d9a2f737a81e /src/main.cpp
parent56a307d734e1284b3d3fb490a59e50014285fa88 (diff)
args: print help on invalid arg
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 99066429..9c52e66f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -50,9 +50,7 @@ int main(int argc, char** argv) {
std::cout << "[ WARNING ] Running Hyprland with superuser privileges might damage your system\n";
ignoreSudo = true;
- }
-
- else if (it->compare("-c") == 0 || it->compare("--config") == 0) {
+ } else if (it->compare("-c") == 0 || it->compare("--config") == 0) {
if (std::next(it)->c_str() == nullptr) {
help();
return 1;
@@ -68,7 +66,13 @@ int main(int argc, char** argv) {
configPath = next_arg;
Debug::log(LOG, "User-specified config location: '%s'", configPath.c_str());
+
+ it++;
+
continue;
+ } else {
+ help();
+ return 0;
}
}