diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-07-23 15:04:46 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-07-23 21:33:17 -0400 |
commit | 863914ec9574eb58cb0746d59f216997c4863cdf (patch) | |
tree | aaddd8ae854d1dde4b50cfd4ef470c1acf83b6ce /sway/commands/focus_wrapping.c | |
parent | Merge pull request #2342 from RyanDwyer/update-cursor (diff) | |
download | sway-863914ec9574eb58cb0746d59f216997c4863cdf.tar.gz sway-863914ec9574eb58cb0746d59f216997c4863cdf.tar.zst sway-863914ec9574eb58cb0746d59f216997c4863cdf.zip |
Switch to using a function to parse booleans
Diffstat (limited to 'sway/commands/focus_wrapping.c')
-rw-r--r-- | sway/commands/focus_wrapping.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sway/commands/focus_wrapping.c b/sway/commands/focus_wrapping.c index 0a9e0bf2..15704228 100644 --- a/sway/commands/focus_wrapping.c +++ b/sway/commands/focus_wrapping.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <strings.h> | 1 | #include <strings.h> |
2 | #include "sway/commands.h" | 2 | #include "sway/commands.h" |
3 | #include "sway/config.h" | 3 | #include "sway/config.h" |
4 | #include "util.h" | ||
4 | 5 | ||
5 | struct cmd_results *cmd_focus_wrapping(int argc, char **argv) { | 6 | struct cmd_results *cmd_focus_wrapping(int argc, char **argv) { |
6 | struct cmd_results *error = NULL; | 7 | struct cmd_results *error = NULL; |
@@ -8,15 +9,12 @@ struct cmd_results *cmd_focus_wrapping(int argc, char **argv) { | |||
8 | return error; | 9 | return error; |
9 | } | 10 | } |
10 | 11 | ||
11 | if (strcasecmp(argv[0], "no") == 0) { | 12 | if (strcmp(argv[0], "force") == 0) { |
12 | config->focus_wrapping = WRAP_NO; | ||
13 | } else if (strcasecmp(argv[0], "yes") == 0) { | ||
14 | config->focus_wrapping = WRAP_YES; | ||
15 | } else if (strcasecmp(argv[0], "force") == 0) { | ||
16 | config->focus_wrapping = WRAP_FORCE; | 13 | config->focus_wrapping = WRAP_FORCE; |
14 | } else if (parse_boolean(argv[0], config->focus_wrapping == WRAP_YES)) { | ||
15 | config->focus_wrapping = WRAP_YES; | ||
17 | } else { | 16 | } else { |
18 | return cmd_results_new(CMD_INVALID, "focus_wrapping", | 17 | config->focus_wrapping = WRAP_NO; |
19 | "Expected 'focus_wrapping yes|no|force'"); | ||
20 | } | 18 | } |
21 | 19 | ||
22 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 20 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |