diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-10-23 10:17:58 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-10-23 10:17:58 +0100 |
commit | 5364255f265da2e324f65369037d5828688d08cd (patch) | |
tree | 8ef7afa00e71186f03a46d3d1ab3467a5e428102 /sway | |
parent | a9fdd5dd2adf1f09ff9df555e7342828abf1a654 (diff) |
commands: remove EXPECTED_MORE_THAN
Its uses have been replaced with EXPECTED_AT_LEAST.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 8 | ||||
-rw-r--r-- | sway/commands/bar/bindsym.c | 2 | ||||
-rw-r--r-- | sway/commands/bind.c | 2 | ||||
-rw-r--r-- | sway/commands/exec_always.c | 4 | ||||
-rw-r--r-- | sway/commands/layout.c | 2 |
5 files changed, 5 insertions, 13 deletions
diff --git a/sway/commands.c b/sway/commands.c index 3f416afc..4c1b34d5 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -20,14 +20,6 @@ struct cmd_results *checkarg(int argc, const char *name, enum expected_args type, int val) { struct cmd_results *error = NULL; switch (type) { - case EXPECTED_MORE_THAN: - if (argc > val) { - return NULL; - } - error = cmd_results_new(CMD_INVALID, name, "Invalid %s command " - "(expected more than %d argument%s, got %d)", - name, val, (char*[2]){"s", ""}[argc==1], argc); - break; case EXPECTED_AT_LEAST: if (argc >= val) { return NULL; diff --git a/sway/commands/bar/bindsym.c b/sway/commands/bar/bindsym.c index 4eea3e6a..965c8903 100644 --- a/sway/commands/bar/bindsym.c +++ b/sway/commands/bar/bindsym.c @@ -10,7 +10,7 @@ struct cmd_results *bar_cmd_bindsym(int argc, char **argv) { struct cmd_results *error = NULL; - if ((error = checkarg(argc, "bar bindsym", EXPECTED_MORE_THAN, 1))) { + if ((error = checkarg(argc, "bar bindsym", EXPECTED_AT_LEAST, 2))) { return error; } if (!config->current_bar) { diff --git a/sway/commands/bind.c b/sway/commands/bind.c index 5832d01e..a9de227f 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c @@ -145,7 +145,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv, const char *bindtype = bindcode ? "bindcode" : "bindsym"; struct cmd_results *error = NULL; - if ((error = checkarg(argc, bindtype, EXPECTED_MORE_THAN, 1))) { + if ((error = checkarg(argc, bindtype, EXPECTED_AT_LEAST, 2))) { return error; } diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 43b35dd7..8bdeceeb 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -16,7 +16,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { struct cmd_results *error = NULL; if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL); - if ((error = checkarg(argc, argv[-1], EXPECTED_MORE_THAN, 0))) { + if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { return error; } @@ -24,7 +24,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { if (strcmp(argv[0], "--no-startup-id") == 0) { wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored."); --argc; ++argv; - if ((error = checkarg(argc, argv[-1], EXPECTED_MORE_THAN, 0))) { + if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { return error; } } diff --git a/sway/commands/layout.c b/sway/commands/layout.c index c2ce2e78..65f67af8 100644 --- a/sway/commands/layout.c +++ b/sway/commands/layout.c @@ -96,7 +96,7 @@ static enum sway_container_layout get_layout(int argc, char **argv, struct cmd_results *cmd_layout(int argc, char **argv) { struct cmd_results *error = NULL; - if ((error = checkarg(argc, "layout", EXPECTED_MORE_THAN, 0))) { + if ((error = checkarg(argc, "layout", EXPECTED_AT_LEAST, 1))) { return error; } struct sway_container *container = config->handler_context.container; |