1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 00:03:12 +02:00

core: add command /allbuf

This commit is contained in:
Sébastien Helleu
2022-12-25 21:23:14 +01:00
parent 2ad6f2f3d5
commit 2c238e08ff
23 changed files with 399 additions and 15 deletions
+35
View File
@@ -88,6 +88,30 @@
extern char **environ;
/*
* Callback for command "/allbuf": executes a command on all buffers.
*/
COMMAND_CALLBACK(allbuf)
{
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) buffer;
COMMAND_MIN_ARGS(2, "");
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
(void) input_data (ptr_buffer, argv_eol[1], NULL);
}
return WEECHAT_RC_OK;
}
/*
* Callback for command "/away".
*
@@ -7436,6 +7460,17 @@ COMMAND_CALLBACK(window)
void
command_init ()
{
hook_command (
NULL, "allbuf",
N_("execute a command on all buffers"),
N_("<command>"),
N_("command: command to execute (or text to send to buffer if "
"command does not start with '/')\n"
"\n"
"Examples:\n"
" set unread marker on all buffers:\n"
" /allbuf /buffer set unread"),
"%(commands:/)", &command_allbuf, NULL, NULL);
hook_command (
NULL, "away",
N_("set or remove away status"),