diff options
author | Connor E <38229097+c-edw@users.noreply.github.com> | 2018-11-10 12:55:06 +0000 |
---|---|---|
committer | Connor E <38229097+c-edw@users.noreply.github.com> | 2018-11-10 12:55:06 +0000 |
commit | b865dabebab717fea75f91e8ccebabc99e36bdd9 (patch) | |
tree | df51bf83b899933f1347508b9f1bd55aefa21ae5 /sway/commands/ws_auto_back_and_forth.c | |
parent | Merge pull request #3085 from 7415963987456321/master (diff) | |
download | sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.gz sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.tar.zst sway-b865dabebab717fea75f91e8ccebabc99e36bdd9.zip |
Use parse_boolean where possible.
Diffstat (limited to 'sway/commands/ws_auto_back_and_forth.c')
-rw-r--r-- | sway/commands/ws_auto_back_and_forth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/commands/ws_auto_back_and_forth.c b/sway/commands/ws_auto_back_and_forth.c index 2485db35..3449d4cc 100644 --- a/sway/commands/ws_auto_back_and_forth.c +++ b/sway/commands/ws_auto_back_and_forth.c | |||
@@ -1,12 +1,14 @@ | |||
1 | #include <string.h> | 1 | #include <string.h> |
2 | #include <strings.h> | 2 | #include <strings.h> |
3 | #include "sway/commands.h" | 3 | #include "sway/commands.h" |
4 | #include "util.h" | ||
4 | 5 | ||
5 | struct cmd_results *cmd_ws_auto_back_and_forth(int argc, char **argv) { | 6 | struct cmd_results *cmd_ws_auto_back_and_forth(int argc, char **argv) { |
6 | struct cmd_results *error = NULL; | 7 | struct cmd_results *error = NULL; |
7 | if ((error = checkarg(argc, "workspace_auto_back_and_forth", EXPECTED_EQUAL_TO, 1))) { | 8 | if ((error = checkarg(argc, "workspace_auto_back_and_forth", EXPECTED_EQUAL_TO, 1))) { |
8 | return error; | 9 | return error; |
9 | } | 10 | } |
10 | config->auto_back_and_forth = !strcasecmp(argv[0], "yes"); | 11 | config->auto_back_and_forth = |
12 | !parse_boolean(argv[0], config->auto_back_and_forth); | ||
11 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 13 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
12 | } | 14 | } |