From fb9d6770208c7f5ecac669517bf258695baae6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 23 Apr 2024 22:54:00 +0200 Subject: [PATCH] doc/api: add changes on functions command and command_options introduced in version 4.0.0 --- doc/en/weechat_plugin_api.en.adoc | 11 ++++++++--- doc/fr/weechat_plugin_api.fr.adoc | 12 +++++++++--- doc/it/weechat_plugin_api.it.adoc | 14 +++++++++++--- doc/ja/weechat_plugin_api.ja.adoc | 15 ++++++++++++--- doc/sr/weechat_plugin_api.sr.adoc | 13 ++++++++++--- src/plugins/python/weechat.pyi | 2 +- 6 files changed, 51 insertions(+), 16 deletions(-) diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index fa51ff16e..191146aa8 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -16691,7 +16691,7 @@ Functions for executing WeeChat commands. ==== command -_Updated in 1.1._ +_Updated in 1.1, 4.0.0._ Execute a command or send text to buffer. @@ -16709,6 +16709,10 @@ Arguments: * _command_: command to execute (if beginning with a "/"), or text to send to buffer +[NOTE] +On buffer with `input_multiline` set to `0` (default), only the first command +is executed (before the first newline char: `\n`). + Return value _(WeeChat ≥ 1.1)_: * _WEECHAT_RC_OK_ if successful @@ -16736,7 +16740,7 @@ rc = weechat.command(weechat.buffer_search("irc", "libera.#weechat"), "/whois Fl ==== command_options -_WeeChat ≥ 2.5._ +_WeeChat ≥ 2.5, updated in 4.0.0._ Execute a command or send text to buffer with options. @@ -16760,6 +16764,7 @@ Arguments: this call; see function <<_string_match_list,string_match_list>> for the format ** _delay_: delay to execute command, in milliseconds +** _split_newline_: `1` to split commands on newline char (`\n`) (_WeeChat ≥ 4.0.0_) Return value: @@ -16790,7 +16795,7 @@ Script (Python): def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: ... # example: allow any command except /exec -rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +rc = weechat.command_options("", "/some_command arguments", {"commands": "*,!exec"}) ---- [[completion]] diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index ba5751aad..88cc1036d 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -17052,7 +17052,7 @@ Fonctions pour exécuter des commandes WeeChat. ==== command -_Mis à jour dans la 1.1._ +_Mis à jour dans la 1.1, 4.0.0._ Exécuter une commande ou envoyer du texte au tampon. @@ -17070,6 +17070,10 @@ Paramètres : * _command_ : commande à exécuter (si elle commence par "/"), ou texte à envoyer au tampon +[NOTE] +Sur un tampon avec `input_multiline` défini à `0` (par défaut), seule la première +commande est exécutée (avant le premier caractère de retour à la ligne : `\n`). + Valeur de retour _(WeeChat ≥ 1.1)_ : * _WEECHAT_RC_OK_ si ok @@ -17097,7 +17101,7 @@ rc = weechat.command(weechat.buffer_search("irc", "libera.#weechat"), "/whois Fl ==== command_options -_WeeChat ≥ 2.5._ +_WeeChat ≥ 2.5, mis à jour dans la 4.0.0._ Exécuter une commande ou envoyer du texte au tampon avec des options. @@ -17121,6 +17125,8 @@ Paramètres : des virgules ; voir la fonction <<_string_match_list,string_match_list>> pour le format ** _delay_ : délai pour exécuter la commande, en millisecondes +** _split_newline_ : `1` pour découper les commandes sur le caractère de retour + à la ligne (`\n`) (_WeeChat ≥ 4.0.0_) Valeur de retour : @@ -17151,7 +17157,7 @@ Script (Python) : def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: ... # exemple : autoriser toute commande sauf /exec -rc = weechat.command("", "/une_commande paramètres", {"commands": "*,!exec"}) +rc = weechat.command_options("", "/une_commande paramètres", {"commands": "*,!exec"}) ---- [[completion]] diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index a30583725..448e68828 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -17477,7 +17477,7 @@ Funzioni per eseguire comandi di WeeChat. ==== command // TRANSLATION MISSING -_Updated in 1.1._ +_Updated in 1.1, 4.0.0._ // TRANSLATION MISSING Execute a command or send text to buffer. @@ -17496,6 +17496,11 @@ Argomenti: * _command_: comando da eseguire (se preceduto da "/"), oppure il testo viene inviato sul buffer +// TRANSLATION MISSING +[NOTE] +On buffer with `input_multiline` set to `0` (default), only the first command +is executed (before the first newline char: `\n`). + Valori restituiti _(WeeChat ≥ 1.1)_: * _WEECHAT_RC_OK_ se l'operazione ha successo @@ -17523,7 +17528,8 @@ rc = weechat.command(weechat.buffer_search("irc", "libera.#weechat"), "/whois Fl ==== command_options -_WeeChat ≥ 2.5._ +// TRANSLATION MISSING +_WeeChat ≥ 2.5, updated in 4.0.0._ // TRANSLATION MISSING Execute a command or send text to buffer with options. @@ -17549,6 +17555,8 @@ Argomenti: this call; see function <<_string_match_list,string_match_list>> for the format ** _delay_: delay to execute command, in milliseconds +// TRANSLATION MISSING +** _split_newline_: `1` to split commands on newline char (`\n`) (_WeeChat ≥ 4.0.0_) Valori restituiti: @@ -17581,7 +17589,7 @@ Script (Python): def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: ... # example: allow any command except /exec -rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +rc = weechat.command_options("", "/some_command arguments", {"commands": "*,!exec"}) ---- // TRANSLATION MISSING diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 51c99f79c..06e626652 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -16940,7 +16940,8 @@ WeeChat コマンドを実行する関数。 ==== command -_WeeChat バージョン 1.1 で更新。_ +// TRANSLATION MISSING +_Updated in 1.1, 4.0.0._ コマンドを実行するか、バッファにテキストを送信。 @@ -16958,6 +16959,11 @@ int weechat_command (struct t_gui_buffer *buffer, const char *command); * _command_: 実行するコマンド ("/" で始まっている場合)、またはバッファに送信するテキスト +// TRANSLATION MISSING +[NOTE] +On buffer with `input_multiline` set to `0` (default), only the first command +is executed (before the first newline char: `\n`). + 戻り値 _(WeeChat バージョン 1.1 以上で利用可)_: * _WEECHAT_RC_OK_ 成功した場合 @@ -16985,7 +16991,8 @@ rc = weechat.command(weechat.buffer_search("irc", "libera.#weechat"), "/whois Fl ==== command_options -_WeeChat バージョン 2.5 以上で利用可。_ +// TRANSLATION MISSING +_WeeChat ≥ 2.5, updated in 4.0.0._ バッファにてオプション付きでコマンドを実行またはテキストを送信 @@ -17010,6 +17017,8 @@ int weechat_command_options (struct t_gui_buffer *buffer, const char *command, ** _commands_: 指定したコマンドの中で実行を許可するコマンドのカンマ区切りリスト、リストの書式は関数 <<_string_match_list,string_match_list>> を参考にしてください ** _delay_: コマンド実行までの遅延時間、ミリ秒単位 +// TRANSLATION MISSING +** _split_newline_: `1` to split commands on newline char (`\n`) (_WeeChat ≥ 4.0.0_) 戻り値: @@ -17040,7 +17049,7 @@ rc = weechat_command_options (NULL, "/some_command arguments", options); def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: ... # 例: /exec 以外のコマンド実行を許可 -rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +rc = weechat.command_options("", "/some_command arguments", {"commands": "*,!exec"}) ---- // TRANSLATION MISSING diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index 0c5840c40..8edefa060 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -16256,7 +16256,7 @@ weechat.bar_remove(my_bar) ==== command -_Ажурирано у верзији 1.1._ +_Ажурирано у верзији 1.1, ажурирано у верзији 4.0.0._ Извршава команду или шаље текст у бафер. @@ -16272,6 +16272,11 @@ int weechat_command (struct t_gui_buffer *buffer, const char *command); * _buffer_: показивач на бафер (команда се извршава у овом баферу, употребите NULL за текући бафер) * _command_: команда која се извршава (ако почиње са „/”), или текст који се шаље у бафер +// TRANSLATION MISSING +[NOTE] +On buffer with `input_multiline` set to `0` (default), only the first command +is executed (before the first newline char: `\n`). + Повратна вредност _(WeeChat ≥ 1.1)_: * _WEECHAT_RC_OK_ ако је успешно @@ -16299,7 +16304,7 @@ rc = weechat.command(weechat.buffer_search("irc", "libera.#weechat"), "/whois Fl ==== command_options -_WeeChat ≥ 2.5._ +_WeeChat ≥ 2.5, ажурирано у верзији 4.0.0._ Извршава команду или шаље текст у бафер са опцијама. @@ -16318,6 +16323,8 @@ int weechat_command_options (struct t_gui_buffer *buffer, const char *command, * _options_: хеш табела са неким опцијама (кључеви и вредности морају бити стринг) (може да буде NULL): ** _commands_: листа команди које смеју да се изврше током овог позива раздвојене запетама; за формат, погледајте функцију <<_string_match_list,string_match_list>> ** _delay_: пауза за извршавање команде, у милисекундама +// TRANSLATION MISSING +** _split_newline_: `1` to split commands on newline char (`\n`) (_WeeChat ≥ 4.0.0_) Повратна вредност: @@ -16348,7 +16355,7 @@ rc = weechat_command_options (NULL, "/some_command arguments", options); def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: ... # пример: дозвољава се било која команда осим /exec -rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +rc = weechat.command_options("", "/some_command arguments", {"commands": "*,!exec"}) ---- [[completion]] diff --git a/src/plugins/python/weechat.pyi b/src/plugins/python/weechat.pyi index 432927b64..6f151b22b 100644 --- a/src/plugins/python/weechat.pyi +++ b/src/plugins/python/weechat.pyi @@ -2278,7 +2278,7 @@ def command_options(buffer: str, command: str, options: Dict[str, str]) -> int: :: # example: allow any command except /exec - rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) + rc = weechat.command_options("", "/some_command arguments", {"commands": "*,!exec"}) """ ...