diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-10-23 10:12:32 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-10-23 10:14:50 +0100 |
commit | a9fdd5dd2adf1f09ff9df555e7342828abf1a654 (patch) | |
tree | bf0e7dbeb208b872738fe4068e3d7c06c19e9353 /sway | |
parent | 970501f05e8a1835b880953888ad3022fb2e9ada (diff) |
commands: print correct command on error for exec and opacity
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/exec_always.c | 8 | ||||
-rw-r--r-- | sway/commands/opacity.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index de78dd83..43b35dd7 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, "exec_always", EXPECTED_MORE_THAN, 0))) { + if ((error = checkarg(argc, argv[-1], EXPECTED_MORE_THAN, 0))) { 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, "exec_always", EXPECTED_MORE_THAN, 0))) { + if ((error = checkarg(argc, argv[-1], EXPECTED_MORE_THAN, 0))) { return error; } } @@ -71,7 +71,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { } else if (pid < 0) { close(fd[0]); close(fd[1]); - return cmd_results_new(CMD_FAILURE, "exec_always", "fork() failed"); + return cmd_results_new(CMD_FAILURE, argv[-1], "fork() failed"); } close(fd[1]); // close write ssize_t s = 0; @@ -85,7 +85,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { wlr_log(WLR_DEBUG, "Child process created with pid %d", child); root_record_workspace_pid(child); } else { - return cmd_results_new(CMD_FAILURE, "exec_always", + return cmd_results_new(CMD_FAILURE, argv[-1], "Second fork() failed"); } diff --git a/sway/commands/opacity.c b/sway/commands/opacity.c index 4e4fc994..8c45b528 100644 --- a/sway/commands/opacity.c +++ b/sway/commands/opacity.c @@ -15,7 +15,7 @@ static bool parse_opacity(const char *opacity, float *val) { struct cmd_results *cmd_opacity(int argc, char **argv) { struct cmd_results *error = NULL; - if ((error = checkarg(argc, "layout", EXPECTED_EQUAL_TO, 1))) { + if ((error = checkarg(argc, "opacity", EXPECTED_EQUAL_TO, 1))) { return error; } |