summaryrefslogtreecommitdiff
path: root/sway/commands/focus_wrapping.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-07-24 19:23:04 +1000
committerGitHub <[email protected]>2018-07-24 19:23:04 +1000
commite02a6718c2c7313309b45e499034d614ee6207fc (patch)
tree429de47906f0ba1f114689c48cbabc5be8bb6e71 /sway/commands/focus_wrapping.c
parent94dd8823a0081f7983dce368d5d093d1d3eeaefe (diff)
parent6ccf2a2c66c1264450a4b3ab3dd344e1b3b44ca3 (diff)
Merge branch 'master' into mouse-bindings
Diffstat (limited to 'sway/commands/focus_wrapping.c')
-rw-r--r--sway/commands/focus_wrapping.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sway/commands/focus_wrapping.c b/sway/commands/focus_wrapping.c
index 0a9e0bf2..562ee4f9 100644
--- a/sway/commands/focus_wrapping.c
+++ b/sway/commands/focus_wrapping.c
@@ -1,6 +1,7 @@
#include <strings.h>
#include "sway/commands.h"
#include "sway/config.h"
+#include "util.h"
struct cmd_results *cmd_focus_wrapping(int argc, char **argv) {
struct cmd_results *error = NULL;
@@ -8,15 +9,12 @@ struct cmd_results *cmd_focus_wrapping(int argc, char **argv) {
return error;
}
- if (strcasecmp(argv[0], "no") == 0) {
- config->focus_wrapping = WRAP_NO;
- } else if (strcasecmp(argv[0], "yes") == 0) {
- config->focus_wrapping = WRAP_YES;
- } else if (strcasecmp(argv[0], "force") == 0) {
+ if (strcasecmp(argv[0], "force") == 0) {
config->focus_wrapping = WRAP_FORCE;
+ } else if (parse_boolean(argv[0], config->focus_wrapping == WRAP_YES)) {
+ config->focus_wrapping = WRAP_YES;
} else {
- return cmd_results_new(CMD_INVALID, "focus_wrapping",
- "Expected 'focus_wrapping yes|no|force'");
+ config->focus_wrapping = WRAP_NO;
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);