mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 16:25:58 +01:00
only return 0 when using -h (#2738)
This commit is contained in:
parent
08310b4af9
commit
7c1dacea09
1 changed files with 8 additions and 1 deletions
|
@ -49,6 +49,7 @@ int main(int argc, char** argv) {
|
||||||
} else if (it->compare("-c") == 0 || it->compare("--config") == 0) {
|
} else if (it->compare("-c") == 0 || it->compare("--config") == 0) {
|
||||||
if (std::next(it) == args.end()) {
|
if (std::next(it) == args.end()) {
|
||||||
help();
|
help();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
std::string next_arg = std::next(it)->c_str();
|
std::string next_arg = std::next(it)->c_str();
|
||||||
|
@ -66,9 +67,15 @@ int main(int argc, char** argv) {
|
||||||
it++;
|
it++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else if (it->compare("-h") == 0 || it->compare("--help") == 0) {
|
||||||
help();
|
help();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
std::cerr << "[ ERROR ] Unknown option '" << it->c_str() << "'!\n";
|
||||||
|
help();
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue