mirror of
https://github.com/swaywm/sway.git
synced 2026-04-20 06:47:03 -04:00
Use parse_boolean where possible.
This commit is contained in:
parent
7fa7f4f48d
commit
b865dabeba
11 changed files with 39 additions and 90 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "sway/tree/container.h"
|
||||
#include "log.h"
|
||||
#include "stringop.h"
|
||||
#include "util.h"
|
||||
|
||||
struct cmd_results *cmd_smart_gaps(int argc, char **argv) {
|
||||
struct cmd_results *error = checkarg(argc, "smart_gaps", EXPECTED_AT_LEAST, 1);
|
||||
|
|
@ -14,14 +15,7 @@ struct cmd_results *cmd_smart_gaps(int argc, char **argv) {
|
|||
return error;
|
||||
}
|
||||
|
||||
if (strcmp(argv[0], "on") == 0) {
|
||||
config->smart_gaps = true;
|
||||
} else if (strcmp(argv[0], "off") == 0) {
|
||||
config->smart_gaps = false;
|
||||
} else {
|
||||
return cmd_results_new(CMD_INVALID, "smart_gaps",
|
||||
"Expected 'smart_gaps <on|off>' ");
|
||||
}
|
||||
config->smart_gaps = parse_boolean(argv[0], config->smart_gaps);
|
||||
|
||||
arrange_root();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue