mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-14 04:45:58 +01:00
args: print help on invalid arg
This commit is contained in:
parent
56a307d734
commit
fa4aef4531
1 changed files with 7 additions and 3 deletions
10
src/main.cpp
10
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";
|
std::cout << "[ WARNING ] Running Hyprland with superuser privileges might damage your system\n";
|
||||||
|
|
||||||
ignoreSudo = true;
|
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) {
|
if (std::next(it)->c_str() == nullptr) {
|
||||||
help();
|
help();
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -68,7 +66,13 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
configPath = next_arg;
|
configPath = next_arg;
|
||||||
Debug::log(LOG, "User-specified config location: '%s'", configPath.c_str());
|
Debug::log(LOG, "User-specified config location: '%s'", configPath.c_str());
|
||||||
|
|
||||||
|
it++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
} else {
|
||||||
|
help();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue