aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/show_marks.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/show_marks.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/show_marks.c')
-rw-r--r--sway/commands/show_marks.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sway/commands/show_marks.c b/sway/commands/show_marks.c
index c7fdc538..434a0e27 100644
--- a/sway/commands/show_marks.c
+++ b/sway/commands/show_marks.c
@@ -7,6 +7,7 @@
#include "list.h"
#include "log.h"
#include "stringop.h"
+#include "util.h"
static void rebuild_marks_iterator(struct sway_container *con, void *data) {
if (con->type == C_VIEW) {
@@ -20,14 +21,7 @@ struct cmd_results *cmd_show_marks(int argc, char **argv) {
return error;
}
- if (strcmp(*argv, "yes") == 0) {
- config->show_marks = true;
- } else if (strcmp(*argv, "no") == 0) {
- config->show_marks = false;
- } else {
- return cmd_results_new(CMD_INVALID, "show_marks",
- "Expected 'show_marks <yes|no>'");
- }
+ config->show_marks = parse_boolean(argv[0], config->show_marks);
if (config->show_marks) {
container_for_each_descendant_dfs(&root_container,