aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/force_focus_wrapping.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-23 21:49:16 -0400
committerGitHub <noreply@github.com>2018-07-23 21:49:16 -0400
commit71774ecd3658653328f3c903869b52c51c62e237 (patch)
treebfc136252f81a5350f240c20161d2d0bfc2f80dd /sway/commands/force_focus_wrapping.c
parent224ade138208e9aa525423cbfbd643aa9d9b63c3 (diff)
parent9ec1d6cf79e6f9c3233f577c6fddeaeb21bb1bfc (diff)
Merge pull request #2340 from RedSoxFan/parse_boolean
Switch to using a function to parse booleans
Diffstat (limited to 'sway/commands/force_focus_wrapping.c')
-rw-r--r--sway/commands/force_focus_wrapping.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/commands/force_focus_wrapping.c b/sway/commands/force_focus_wrapping.c
index bc1d067f..0892d9e9 100644
--- a/sway/commands/force_focus_wrapping.c
+++ b/sway/commands/force_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_force_focus_wrapping(int argc, char **argv) {
struct cmd_results *error =
@@ -9,13 +10,10 @@ struct cmd_results *cmd_force_focus_wrapping(int argc, char **argv) {
return error;
}
- if (strcasecmp(argv[0], "no") == 0) {
- config->focus_wrapping = WRAP_YES;
- } else if (strcasecmp(argv[0], "yes") == 0) {
+ if (parse_boolean(argv[0], config->focus_wrapping == WRAP_FORCE)) {
config->focus_wrapping = WRAP_FORCE;
} else {
- return cmd_results_new(CMD_INVALID, "force_focus_wrapping",
- "Expected 'force_focus_wrapping yes|no'");
+ config->focus_wrapping = WRAP_YES;
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);