mirror of
https://github.com/hexchat/hexchat.git
synced 2024-11-08 12:12:39 +01:00
Add -q/-- flags to /execwrite to EXECWRITE and cmd_execW (#2675)
added two flags to EXECWRITE and cmd_execw -q : (quiet) to allow suppressing of additional (debug) output at the text box -- : (stop parsing for further flags) for the edge cases where -q itself migh be part of used data and the user wants to show that at the text box Closes #2666
This commit is contained in:
parent
1de339dfbc
commit
7cff05c7ac
@ -1579,9 +1579,26 @@ cmd_execw (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
EMIT_SIGNAL (XP_TE_NOCHILD, sess, NULL, NULL, NULL, NULL, 0);
|
||||
return FALSE;
|
||||
}
|
||||
len = strlen(word_eol[2]);
|
||||
temp = g_strconcat (word_eol[2], "\n", NULL);
|
||||
PrintText(sess, temp);
|
||||
if (strcmp (word[2], "--") == 0)
|
||||
{
|
||||
len = strlen(word_eol[3]);
|
||||
temp = g_strconcat (word_eol[3], "\n", NULL);
|
||||
PrintText(sess, temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcmp (word[2], "-q") == 0)
|
||||
{
|
||||
len = strlen(word_eol[3]);
|
||||
temp = g_strconcat (word_eol[3], "\n", NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = strlen(word_eol[2]);
|
||||
temp = g_strconcat (word_eol[2], "\n", NULL);
|
||||
PrintText(sess, temp);
|
||||
}
|
||||
}
|
||||
write(sess->running_exec->myfd, temp, len + 1);
|
||||
g_free(temp);
|
||||
|
||||
@ -3977,7 +3994,7 @@ const struct commands xc_cmds[] = {
|
||||
N_("EXECKILL [-9], kills a running exec in the current session. If -9 is given the process is SIGKILL'ed")},
|
||||
#ifndef __EMX__
|
||||
{"EXECSTOP", cmd_execs, 0, 0, 1, N_("EXECSTOP, sends the process SIGSTOP")},
|
||||
{"EXECWRITE", cmd_execw, 0, 0, 1, N_("EXECWRITE, sends data to the processes stdin")},
|
||||
{"EXECWRITE", cmd_execw, 0, 0, 1, N_("EXECWRITE [-q|--], sends data to the processes stdin; use -q flag to quiet/suppress output at text box; use -- flag to stop interpreting arguments as flags, needed if -q itself would occur as data")},
|
||||
#endif
|
||||
#endif
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user