diff options
Diffstat (limited to 'hyprctl/main.cpp')
| -rw-r--r-- | hyprctl/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 92ab4f5e..8d9b6d96 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -215,7 +215,7 @@ int main(int argc, char** argv) { const auto ARGS = splitArgs(argc, argv); for (auto i = 0; i < ARGS.size(); ++i) { - if (ARGS[i].contains("-")) { + if (ARGS[i][0] == '-') { // parse if (ARGS[i] == "-j" && !fullArgs.contains("j")) { fullArgs += "j"; @@ -232,6 +232,11 @@ int main(int argc, char** argv) { fullRequest += ARGS[i] + " "; } + if (fullRequest.empty()) { + printf("%s\n", USAGE.c_str()); + return 1; + } + fullRequest.pop_back(); // remove trailing space fullRequest = fullArgs + "/" + fullRequest; |
