aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-06-17 21:23:48 +0100
committerGitHub <[email protected]>2022-06-17 21:23:48 +0100
commitf7bdc2e87020ea7308035bceaa2ab659af91d2de (patch)
tree02ed984d9afa80a3e4fc30bb1ef8b31ec6d0b41c
parentf428604b6fd97d94fbce0943be0c2d4fd5cb7158 (diff)
parentfaa1b5a44fcfe7693838fa3d7ccc9e6b64480b2f (diff)
downloadHyprland-f7bdc2e87020ea7308035bceaa2ab659af91d2de.tar.gz
Hyprland-f7bdc2e87020ea7308035bceaa2ab659af91d2de.zip
Merge pull request #234 from alba4k/main
revised makefile, newline after execution
-rw-r--r--hyprctl/Makefile6
-rw-r--r--hyprctl/main.cpp14
2 files changed, 10 insertions, 10 deletions
diff --git a/hyprctl/Makefile b/hyprctl/Makefile
index d279830a..0e997886 100644
--- a/hyprctl/Makefile
+++ b/hyprctl/Makefile
@@ -1,4 +1,4 @@
-clean:
- rm -rf ./hyprctl ./hyprctl
all:
- g++ -std=c++20 ./main.cpp -o ./hyprctl \ No newline at end of file
+ g++ -std=c++20 ./main.cpp -o ./hyprctl
+clean:
+ rm ./hyprctl \ No newline at end of file
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp
index d0c7d9ed..f60fb600 100644
--- a/hyprctl/main.cpp
+++ b/hyprctl/main.cpp
@@ -15,8 +15,7 @@
#include <fstream>
#include <string>
-const std::string USAGE = R"#(
-usage: hyprctl [command] [(opt)args]
+const std::string USAGE = R"#(usage: hyprctl [command] [(opt)args]
monitors
workspaces
@@ -27,8 +26,7 @@ usage: hyprctl [command] [(opt)args]
dispatch
keyword
version
- reload
-)#";
+ reload)#";
void request(std::string arg) {
const auto SERVERSOCKET = socket(AF_UNIX, SOCK_STREAM, 0);
@@ -121,7 +119,7 @@ int main(int argc, char** argv) {
int bflag = 0, sflag = 0, index, c;
if (argc < 2) {
- printf("%s", USAGE.c_str());
+ printf("%s\n", USAGE.c_str());
return 1;
}
@@ -136,10 +134,12 @@ int main(int argc, char** argv) {
else if (!strcmp(argv[1], "dispatch")) dispatchRequest(argc, argv);
else if (!strcmp(argv[1], "keyword")) keywordRequest(argc, argv);
else if (!strcmp(argv[1], "--batch")) batchRequest(argc, argv);
+ else if (!strcmp(argv[1], "--help")) printf("%s", USAGE.c_str());
else {
- printf("%s", USAGE.c_str());
+ printf("%s\n", USAGE.c_str());
return 1;
}
+ printf("\n");
return 0;
-} \ No newline at end of file
+}