From b374c35758777f98e5ddbe4b0dc43bd7c80f36d7 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Thu, 1 Sep 2016 21:39:08 -0500 Subject: refactor commands.c --- sway/commands/smart_gaps.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sway/commands/smart_gaps.c (limited to 'sway/commands/smart_gaps.c') diff --git a/sway/commands/smart_gaps.c b/sway/commands/smart_gaps.c new file mode 100644 index 00000000..d1266a13 --- /dev/null +++ b/sway/commands/smart_gaps.c @@ -0,0 +1,19 @@ +#include +#include "commands.h" + +struct cmd_results *cmd_smart_gaps(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "smart_gaps", EXPECTED_EQUAL_TO, 1))) { + return error; + } + + if (strcasecmp(argv[0], "on") == 0) { + config->smart_gaps = true; + } else if (strcasecmp(argv[0], "off") == 0) { + config->smart_gaps = false; + } else { + return cmd_results_new(CMD_INVALID, "smart_gaps", "Expected 'smart_gaps '"); + } + + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} -- cgit v1.2.3 From 65ace5dec5c24695501056376e227fb9b1f84a3a Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Fri, 2 Sep 2016 14:11:48 -0500 Subject: merge in latest commits --- sway/commands/smart_gaps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands/smart_gaps.c') diff --git a/sway/commands/smart_gaps.c b/sway/commands/smart_gaps.c index d1266a13..bd50d6bc 100644 --- a/sway/commands/smart_gaps.c +++ b/sway/commands/smart_gaps.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_smart_gaps(int argc, char **argv) { struct cmd_results *error = NULL; -- cgit v1.2.3