aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/smart_gaps.c
diff options
context:
space:
mode:
authorLibravatar Connor E <38229097+c-edw@users.noreply.github.com>2018-11-10 12:55:06 +0000
committerLibravatar Connor E <38229097+c-edw@users.noreply.github.com>2018-11-10 12:55:06 +0000
commitb865dabebab717fea75f91e8ccebabc99e36bdd9 (patch)
treedf51bf83b899933f1347508b9f1bd55aefa21ae5 /sway/commands/smart_gaps.c
parentMerge pull request #3085 from 7415963987456321/master (diff)
downloadsway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.gz
sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.zst
sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.zip
Use parse_boolean where possible.
Diffstat (limited to 'sway/commands/smart_gaps.c')
-rw-r--r--sway/commands/smart_gaps.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sway/commands/smart_gaps.c b/sway/commands/smart_gaps.c
index 273905df..f14b6760 100644
--- a/sway/commands/smart_gaps.c
+++ b/sway/commands/smart_gaps.c
@@ -6,6 +6,7 @@
6#include "sway/tree/container.h" 6#include "sway/tree/container.h"
7#include "log.h" 7#include "log.h"
8#include "stringop.h" 8#include "stringop.h"
9#include "util.h"
9 10
10struct cmd_results *cmd_smart_gaps(int argc, char **argv) { 11struct cmd_results *cmd_smart_gaps(int argc, char **argv) {
11 struct cmd_results *error = checkarg(argc, "smart_gaps", EXPECTED_AT_LEAST, 1); 12 struct cmd_results *error = checkarg(argc, "smart_gaps", EXPECTED_AT_LEAST, 1);
@@ -14,14 +15,7 @@ struct cmd_results *cmd_smart_gaps(int argc, char **argv) {
14 return error; 15 return error;
15 } 16 }
16 17
17 if (strcmp(argv[0], "on") == 0) { 18 config->smart_gaps = parse_boolean(argv[0], config->smart_gaps);
18 config->smart_gaps = true;
19 } else if (strcmp(argv[0], "off") == 0) {
20 config->smart_gaps = false;
21 } else {
22 return cmd_results_new(CMD_INVALID, "smart_gaps",
23 "Expected 'smart_gaps <on|off>' ");
24 }
25 19
26 arrange_root(); 20 arrange_root();
27 21