1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

core: add tags of lines in hsignal sent with command /pipe

This commit is contained in:
Sébastien Helleu
2025-01-25 17:06:10 +01:00
parent 56698151db
commit b53f3c2db8
17 changed files with 424 additions and 376 deletions
+4 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2777,8 +2777,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "vykonat příkaz na všech připojených serverech"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+332 -323
View File
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2839,8 +2839,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "ejecuta un comando en todos los servidores conectados"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+8 -6
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"PO-Revision-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2025-01-25 17:05+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -3036,11 +3036,13 @@ msgid "raw[-file]: write command output in this file"
msgstr "raw[-file] : écrire la sortie de la commande dans ce fichier"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
"raw[-hsignal]: envoyer la sortie de la commande sous forme de hsignal "
"(clés: \"command\" et \"output\")"
"raw[-hsignal]: envoyer la sortie de la commande sous forme de hsignal; "
"clés: \"command\", \"output\" (lignes séparées par le séparateur) et "
"\"tags\" (étiquettes de chaque ligne séparées par un retour chariot)"
msgid ""
"raw[-o]: send command output to the buffer as input; colors are stripped and "
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2689,8 +2689,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "üzenet küldése az összes csatlakoztatott szerver összes szobájába"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2792,8 +2792,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "esegue un comando su tutti i server connessi"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -2832,8 +2832,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "全ての接続済みサーバでコマンドを実行"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-12-16 12:01+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3059,8 +3059,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "raw[-buffer]: wykonuje komendę w tym buforze"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -2848,8 +2848,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "executar um comando em todos os servidores conectados"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2802,8 +2802,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "executa um comando várias vezes"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2024-11-20 18:17+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2713,8 +2713,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "отправить сообщение на все каналы всех поключенных серверов"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+15 -11
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2025-01-21 12:27+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2936,12 +2936,16 @@ msgstr ""
msgid "raw[-file]: write command output in this file"
msgstr "raw[-file]: уписује излаз команде у овај фајл"
#, fuzzy
#| msgid ""
#| "raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
#| "\"output\")"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
"raw[-hsignal]: шаље излаз команде као hsignal (кључеви: „command” и "
"„output”)"
"raw[-hsignal]: шаље излаз команде као hsignal (кључеви: „command” и „output”)"
msgid ""
"raw[-o]: send command output to the buffer as input; colors are stripped and "
@@ -2954,8 +2958,8 @@ msgid ""
"raw[-concat]: concatenate all lines displayed using a separator; chars can "
"be escaped (example: \\x20 for space)"
msgstr ""
"raw[-concat]: спаја све приказане линије користећи граничник; карактери "
"могу да се означе (пример: \\x20 за размак)"
"raw[-concat]: спаја све приказане линије користећи граничник; карактери могу "
"да се означе (пример: \\x20 за размак)"
msgid ""
"raw[-strip]: strip chars from lines (beginning/end); chars can be escaped "
@@ -2988,8 +2992,8 @@ msgid ""
"Note: for commands that display messages in an asynchronous way (like /exec "
"and many IRC commands), the output will not be caught by this command."
msgstr ""
"Напомена: у случају команди које поруке приказују на асинхрони начин (као "
"/exec и многе IRC команде), ова команда неће ухватити излаз."
"Напомена: у случају команди које поруке приказују на асинхрони начин (као /"
"exec и многе IRC команде), ова команда неће ухватити излаз."
msgid ""
"For example \"/pipe /whois nick\" will NOT redirect the answer from IRC "
@@ -3923,8 +3927,8 @@ msgid ""
"raw[-v]: verbose mode: display information about upgrades of WeeChat with /"
"upgrade"
msgstr ""
"raw[-v]: детаљни режим: приказује информације о ажурирањима програма "
"WeeChat са /upgrade"
"raw[-v]: детаљни режим: приказује информације о ажурирањима програма WeeChat "
"са /upgrade"
msgid ""
"The default alias /v can be used to execute this command on all buffers "
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2025-01-04 18:21+0100\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2814,8 +2814,9 @@ msgid "raw[-file]: write command output in this file"
msgstr "tüm arabelleklerde bir komut yürüt"
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-01-07 20:32+0100\n"
"POT-Creation-Date: 2025-01-25 17:03+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2537,8 +2537,9 @@ msgid "raw[-file]: write command output in this file"
msgstr ""
msgid ""
"raw[-hsignal]: send command output as hsignal (keys: \"command\" and "
"\"output\")"
"raw[-hsignal]: send command output as hsignal; keys: \"command\", \"output\" "
"(lines separated by separator) and \"tags\" (tags of each line separated by "
"newline)"
msgstr ""
msgid ""
+4 -2
View File
@@ -5113,6 +5113,7 @@ COMMAND_CALLBACK(pipe)
gui_chat_pipe_hsignal = strdup (ptr_hsignal);
if (!gui_chat_pipe_hsignal)
COMMAND_ERROR;
gui_chat_pipe_concat_tags = string_dyn_alloc (1024);
}
else
{
@@ -9343,8 +9344,9 @@ command_init ()
N_("name: full buffer name (examples: \"core.weechat\", "
"\"irc.server.libera\", \"irc.libera.#weechat\")"),
N_("raw[-file]: write command output in this file"),
N_("raw[-hsignal]: send command output as hsignal "
"(keys: \"command\" and \"output\")"),
N_("raw[-hsignal]: send command output as hsignal; "
"keys: \"command\", \"output\" (lines separated by separator) "
"and \"tags\" (tags of each line separated by newline)"),
N_("raw[-o]: send command output to the buffer as input; "
"colors are stripped and commands are NOT executed "
"(used only with -buffer)"),
+20 -1
View File
@@ -70,6 +70,7 @@ FILE *gui_chat_pipe_file = NULL; /* pipe msgs to a file */
char *gui_chat_pipe_hsignal = NULL; /* pipe msgs to a hsignal */
char *gui_chat_pipe_concat_sep = NULL; /* separator to concat lines*/
char **gui_chat_pipe_concat_lines = NULL; /* concatenated lines */
char **gui_chat_pipe_concat_tags = NULL; /* concatenated tags */
char *gui_chat_pipe_strip_chars = NULL; /* chars to strip on lines */
int gui_chat_pipe_skip_empty_lines = 0; /* skip empty lines */
@@ -678,7 +679,7 @@ gui_chat_pipe_send_buffer_input (struct t_gui_buffer *buffer, const char *data)
int
gui_chat_pipe_handle_line (struct t_gui_line *line)
{
char *data, *data2;
char *data, *data2, *tags;
int rc;
if (!line || !gui_chat_pipe)
@@ -709,6 +710,17 @@ gui_chat_pipe_handle_line (struct t_gui_line *line)
string_dyn_concat (gui_chat_pipe_concat_lines, data2, -1);
}
free (data2);
/* concatenate tags */
if (gui_chat_pipe_concat_tags)
{
tags = string_rebuild_split_string (
(const char **)line->data->tags_array,
",", 0, -1);
if ((*gui_chat_pipe_concat_tags)[0])
string_dyn_concat (gui_chat_pipe_concat_tags, "\n", -1);
string_dyn_concat (gui_chat_pipe_concat_tags, (tags) ? tags : "", -1);
free (tags);
}
rc = 1;
}
else if (gui_chat_pipe_file)
@@ -786,6 +798,8 @@ gui_chat_pipe_end ()
{
hashtable_set (hashtable, "command", gui_chat_pipe_command);
hashtable_set (hashtable, "output", *gui_chat_pipe_concat_lines);
if (gui_chat_pipe_concat_tags)
hashtable_set (hashtable, "tags", *gui_chat_pipe_concat_tags);
hook_hsignal_send (gui_chat_pipe_hsignal, hashtable);
hashtable_free (hashtable);
}
@@ -800,6 +814,11 @@ gui_chat_pipe_end ()
gui_chat_pipe_command = NULL;
free (gui_chat_pipe_hsignal);
gui_chat_pipe_hsignal = NULL;
if (gui_chat_pipe_concat_tags)
{
string_dyn_free (gui_chat_pipe_concat_tags, 1);
gui_chat_pipe_concat_tags = NULL;
}
}
/*
+1
View File
@@ -79,6 +79,7 @@ extern FILE *gui_chat_pipe_file;
extern char *gui_chat_pipe_hsignal;
extern char *gui_chat_pipe_concat_sep;
extern char **gui_chat_pipe_concat_lines;
extern char **gui_chat_pipe_concat_tags;
extern char *gui_chat_pipe_strip_chars;
extern int gui_chat_pipe_skip_empty_lines;