summaryrefslogtreecommitdiff
path: root/src/plugins/exec/exec.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-03-11 09:52:08 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-03-11 17:49:49 +0100
commitee2cb329f4c2721bee63ec1966b1a953e47081aa (patch)
treee9bc55e09ce5a95a2a00107fb7b8c97670d2e4a7 /src/plugins/exec/exec.c
parent9355c867edc8f894c6e2936eb066f828668168e6 (diff)
downloadweechat-ee2cb329f4c2721bee63ec1966b1a953e47081aa.zip
exec: display command return code after output (stdout/stderr)
Diffstat (limited to 'src/plugins/exec/exec.c')
-rw-r--r--src/plugins/exec/exec.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c
index 5758485f3..9ab44cf9a 100644
--- a/src/plugins/exec/exec.c
+++ b/src/plugins/exec/exec.c
@@ -243,29 +243,31 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code)
ptr_buffer = weechat_buffer_search (exec_cmd->buffer_plugin,
exec_cmd->buffer_name);
+ /* display stdout/stderr (if output to buffer, the buffer must exist) */
+ exec_command_display_output (exec_cmd, ptr_buffer, 1);
+ exec_command_display_output (exec_cmd, ptr_buffer, 0);
+
/* display return code (only if output is NOT sent to buffer) */
if (!exec_cmd->output_to_buffer)
{
if (return_code >= 0)
{
weechat_printf_tags (ptr_buffer, "exec_rc",
- "%s: end of command \"%s\" (rc=%d)",
- EXEC_PLUGIN_NAME, exec_cmd->command,
- return_code);
+ _("%s: end of command %d (\"%s\"), "
+ "return code: %d"),
+ EXEC_PLUGIN_NAME, exec_cmd->number,
+ exec_cmd->command, return_code);
}
else
{
weechat_printf_tags (ptr_buffer, "exec_rc",
- _("%s%s: unexpected end of command \"%s\""),
+ _("%s%s: unexpected end of command %d "
+ "(\"%s\")"),
weechat_prefix ("error"), EXEC_PLUGIN_NAME,
- exec_cmd->command);
+ exec_cmd->number, exec_cmd->command);
}
}
- /* display stdout/stderr (if output to buffer, the buffer must exist) */
- exec_command_display_output (exec_cmd, ptr_buffer, 1);
- exec_command_display_output (exec_cmd, ptr_buffer, 0);
-
/* (re)set some variables after the end of command */
exec_cmd->hook = NULL;
exec_cmd->pid = 0;