summaryrefslogtreecommitdiff
path: root/hyprctl/main.cpp
diff options
context:
space:
mode:
authorDarksome <dev@darkso.me>2022-07-16 12:40:02 +0300
committerDarksome <dev@darkso.me>2022-07-16 12:40:02 +0300
commite56ff0fcb05fa8ab2c4328c54f734bf46e76ef06 (patch)
treef864b79097a3888f3c0b99ad4ba844b37f36e3f5 /hyprctl/main.cpp
parent43b7da0bb1bde522c890eba513c8b4b546c3a328 (diff)
parentb2650928eac06e3181ad07efe6ec55b2550f89b8 (diff)
Merge remote-tracking branch 'upstream/main' into mouse-wheel-cfg
Diffstat (limited to 'hyprctl/main.cpp')
-rw-r--r--hyprctl/main.cpp7
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;