mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 03:11:27 +00:00
Merge pull request #272 from mikkeloscar/output-cmd-warnings
Add warnings about invalid output commands
This commit is contained in:
commit
01c5349e1a
|
@ -767,8 +767,14 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
|
||||||
output->y = y;
|
output->y = y;
|
||||||
} else if (strcasecmp(argv[i], "bg") == 0 || strcasecmp(argv[i], "background") == 0) {
|
} else if (strcasecmp(argv[i], "bg") == 0 || strcasecmp(argv[i], "background") == 0) {
|
||||||
wordexp_t p;
|
wordexp_t p;
|
||||||
char *src = argv[++i];
|
if (++i >= argc) {
|
||||||
char *mode = argv[++i];
|
return cmd_results_new(CMD_INVALID, "output", "Missing background file.");
|
||||||
|
}
|
||||||
|
char *src = argv[i];
|
||||||
|
if (++i >= argc) {
|
||||||
|
return cmd_results_new(CMD_INVALID, "output", "Missing background scaling mode.");
|
||||||
|
}
|
||||||
|
char *mode = argv[i];
|
||||||
if (wordexp(src, &p, 0) != 0) {
|
if (wordexp(src, &p, 0) != 0) {
|
||||||
return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src);
|
return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue