aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2017-12-14 00:50:01 +0100
committerLibravatar emersion <contact@emersion.fr>2017-12-14 00:50:01 +0100
commit9254c5a93f1a38612d5391e34e4fe3b6c9e433a7 (patch)
treef2d36f9ab5f73b03d98e4df8047d228d6c6e4ac6 /sway/commands/output.c
parentReplace refresh_rate and position by mode in output command (diff)
downloadsway-9254c5a93f1a38612d5391e34e4fe3b6c9e433a7.tar.gz
sway-9254c5a93f1a38612d5391e34e4fe3b6c9e433a7.tar.zst
sway-9254c5a93f1a38612d5391e34e4fe3b6c9e433a7.zip
Fail if unknown output subcommand
Diffstat (limited to 'sway/commands/output.c')
-rw-r--r--sway/commands/output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/commands/output.c b/sway/commands/output.c
index daaacad7..16b711f1 100644
--- a/sway/commands/output.c
+++ b/sway/commands/output.c
@@ -192,7 +192,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
192 192
193 char *src = join_args(argv + i, j); 193 char *src = join_args(argv + i, j);
194 if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) { 194 if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) {
195 error = cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src); 195 error = cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s).", src);
196 goto fail; 196 goto fail;
197 } 197 }
198 free(src); 198 free(src);
@@ -213,7 +213,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
213 } 213 }
214 } 214 }
215 if (!src || access(src, F_OK) == -1) { 215 if (!src || access(src, F_OK) == -1) {
216 error = cmd_results_new(CMD_INVALID, "output", "Background file unreadable (%s)", src); 216 error = cmd_results_new(CMD_INVALID, "output", "Background file unreadable (%s).", src);
217 wordfree(&p); 217 wordfree(&p);
218 goto fail; 218 goto fail;
219 } 219 }
@@ -227,6 +227,9 @@ struct cmd_results *cmd_output(int argc, char **argv) {
227 227
228 i += j; 228 i += j;
229 } 229 }
230 } else {
231 error = cmd_results_new(CMD_INVALID, "output", "Invalid output subcommand: %s.", command);
232 goto fail;
230 } 233 }
231 } 234 }
232 235