mirror of
https://github.com/hyprwm/hypridle.git
synced 2026-01-06 09:20:08 +01:00
feat: return an error if the next argument after -c is a flag
This commit is contained in:
parent
f60bff7e3d
commit
4e336530d3
1 changed files with 5 additions and 1 deletions
|
|
@ -17,11 +17,15 @@ int main(int argc, char** argv, char** envp) {
|
|||
|
||||
else if (arg == "--config" || arg == "-c") {
|
||||
if (i + 1 >= argc) {
|
||||
Debug::log(NONE, "Please provide a path to a config file.");
|
||||
Debug::log(NONE, "After " + arg + " you should provide a path to a config file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
configPath = argv[++i];
|
||||
if (configPath[0] == '-') { // Should be fine, because of the null terminator
|
||||
Debug::log(NONE, "After " + arg + " you should provide a path to a config file.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue