diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2019-02-28 00:14:38 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-02-28 20:19:18 +0100 |
commit | 80b980b2af71faa9a2d825c61a5d41d7ace0dc60 (patch) | |
tree | 64056a5a5fb428869b62c6c0309155c67acbc432 /doc | |
parent | 64043d5a6c4ca258c40a8c39d0f58fc4a16c86b9 (diff) | |
download | weechat-80b980b2af71faa9a2d825c61a5d41d7ace0dc60.zip |
api: add function command_options (issue #928)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/weechat_scripting.de.adoc | 3 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 57 | ||||
-rw-r--r-- | doc/en/weechat_scripting.en.adoc | 3 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.adoc | 57 | ||||
-rw-r--r-- | doc/fr/weechat_scripting.fr.adoc | 5 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 61 | ||||
-rw-r--r-- | doc/it/weechat_scripting.it.adoc | 3 | ||||
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 61 | ||||
-rw-r--r-- | doc/ja/weechat_scripting.ja.adoc | 5 | ||||
-rw-r--r-- | doc/pl/weechat_scripting.pl.adoc | 7 |
10 files changed, 252 insertions, 10 deletions
diff --git a/doc/de/weechat_scripting.de.adoc b/doc/de/weechat_scripting.de.adoc index 0187722ec..352277c37 100644 --- a/doc/de/weechat_scripting.de.adoc +++ b/doc/de/weechat_scripting.de.adoc @@ -604,7 +604,8 @@ Liste der Skript API Funktionen: bar_remove | Befehle | - command + command + + command_options | Informationen | info_get + diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index c60adc90e..edc10be7c 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -14375,6 +14375,63 @@ weechat.command(buffer, command) rc = weechat.command(weechat.buffer_search("irc", "freenode.#weechat"), "/whois FlashCode") ---- +==== command_options + +_WeeChat ≥ 2.5._ + +Execute a command or send text to buffer with options. + +Prototype: + +[source,C] +---- +int weechat_command_options (struct t_gui_buffer *buffer, const char *command, + struct t_hashtable *options); +---- + +Arguments: + +* _buffer_: buffer pointer (command is executed on this buffer, use NULL for + current buffer) +* _command_: command to execute (if beginning with a "/"), or text to send to + buffer +* _options_: a hashtable with some options (keys and values must be string) + (can be NULL): +** _commands_: a comma-separated list of commands allowed to be executed during + this call; see function <<_string_match_list,string_match_list>> for the + format + +Return value: + +* _WEECHAT_RC_OK_ if successful +* _WEECHAT_RC_ERROR_ if error + +C example: + +[source,C] +---- +/* allow any command except /exec */ +int rc; +struct t_hashtable *options = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options, "commands", "*,!exec"); +rc = weechat_command_options (NULL, "/some_command arguments", options); +---- + +Script (Python): + +[source,python] +---- +# prototype +weechat.command_options(buffer, command, options) + +# example: allow any command except /exec +rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +---- + [[network]] === Network diff --git a/doc/en/weechat_scripting.en.adoc b/doc/en/weechat_scripting.en.adoc index 166416bea..eebd7ffd0 100644 --- a/doc/en/weechat_scripting.en.adoc +++ b/doc/en/weechat_scripting.en.adoc @@ -591,7 +591,8 @@ List of functions in script API: bar_remove | commands | - command + command + + command_options | infos | info_get + diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 2f263a2a3..b6805684f 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -14691,6 +14691,63 @@ weechat.command(buffer, command) rc = weechat.command(weechat.buffer_search("irc", "freenode.#weechat"), "/whois FlashCode") ---- +==== command_options + +_WeeChat ≥ 2.5._ + +Exécuter une commande ou envoyer du texte au tampon avec des options. + +Prototype : + +[source,C] +---- +int weechat_command_options (struct t_gui_buffer *buffer, const char *command, + struct t_hashtable *options); +---- + +Paramètres : + +* _buffer_ : pointeur vers le tampon (la commande est exécutée sur ce tampon, + NULL pour le tampon courant) +* _command_ : commande à exécuter (si elle commence par "/"), ou texte à + envoyer au tampon +* _options_ : table de hachage avec des options (les clés et valeurs doivent + être des chaînes) (peut être NULL) : +** _commands_ : une liste de commandes autorisées pendant l'appel, séparées par + des virgules ; voir la fonction <<_string_match_list,string_match_list>> + pour le format + +Valeur de retour : + +* _WEECHAT_RC_OK_ si ok +* _WEECHAT_RC_ERROR_ si erreur + +Exemple en C : + +[source,C] +---- +/* autoriser toute commande sauf /exec */ +int rc; +struct t_hashtable *options = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options, "commands", "*,!exec"); +rc = weechat_command_options (NULL, "/une_commande paramètres", options); +---- + +Script (Python) : + +[source,python] +---- +# prototype +weechat.command_options(buffer, command, options) + +# exemple : autoriser toute commande sauf /exec +rc = weechat.command("", "/une_commande paramètres", {"commands": "*,!exec"}) +---- + [[network]] === Réseau diff --git a/doc/fr/weechat_scripting.fr.adoc b/doc/fr/weechat_scripting.fr.adoc index a7c3fb075..61acecebc 100644 --- a/doc/fr/weechat_scripting.fr.adoc +++ b/doc/fr/weechat_scripting.fr.adoc @@ -603,9 +603,10 @@ Liste des fonctions de l'API script : bar_remove | commandes | - command + command + + command_options -| infos | +| infos | info_get + info_get_hashtable diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index b8c189798..899747e7e 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -14953,6 +14953,67 @@ weechat.command(buffer, command) rc = weechat.command(weechat.buffer_search("irc", "freenode.#weechat"), "/whois FlashCode") ---- +==== command_options + +_WeeChat ≥ 2.5._ + +// TRANSLATION MISSING +Execute a command or send text to buffer with options. + +Prototipo: + +[source,C] +---- +int weechat_command_options (struct t_gui_buffer *buffer, const char *command, + struct t_hashtable *options); +---- + +Argomenti: + +* _buffer_: puntatore al buffer (il comando viene eseguito su questo buffer, + utilizzare NULL per il buffer corrente) +* _command_: comando da eseguire (se preceduto da "/"), oppure il testo + viene inviato sul buffer +// TRANSLATION MISSING +* _options_: a hashtable with some options (keys and values must be string) + (can be NULL): +** _commands_: a comma-separated list of commands allowed to be executed during + this call; see function <<_string_match_list,string_match_list>> for the + format + +Valori restituiti: + +* _WEECHAT_RC_OK_ se l'operazione ha successo +* _WEECHAT_RC_ERROR_ se c'è un errore + +Esempio in C: + +// TRANSLATION MISSING +[source,C] +---- +/* allow any command except /exec */ +int rc; +struct t_hashtable *options = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options, "commands", "*,!exec"); +rc = weechat_command_options (NULL, "/some_command arguments", options); +---- + +Script (Python): + +// TRANSLATION MISSING +[source,python] +---- +# prototipo +weechat.command_options(buffer, command, options) + +# example: allow any command except /exec +rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +---- + [[network]] === Network diff --git a/doc/it/weechat_scripting.it.adoc b/doc/it/weechat_scripting.it.adoc index 113243d81..0756dc6cc 100644 --- a/doc/it/weechat_scripting.it.adoc +++ b/doc/it/weechat_scripting.it.adoc @@ -611,7 +611,8 @@ Elenco di funzioni nelle API per gli script: bar_remove | comandi | - comando + command + + command_options | info | info_get + diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index a5d56088f..77f5c587f 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -14335,6 +14335,67 @@ weechat.command(buffer, command) rc = weechat.command(weechat.buffer_search("irc", "freenode.#weechat"), "/whois FlashCode") ---- +==== command_options + +_WeeChat ≥ 2.5._ + +// TRANSLATION MISSING +Execute a command or send text to buffer with options. + +プロトタイプ: + +[source,C] +---- +int weechat_command_options (struct t_gui_buffer *buffer, const char *command, + struct t_hashtable *options); +---- + +引数: + +* _buffer_: バッファへのポインタ + (コマンドは指定したバッファで実行されます、現在のバッファで実行するには NULL を指定してください) +* _command_: 実行するコマンド ("/" + で始まっている場合)、またはバッファに送信するテキスト +// TRANSLATION MISSING +* _options_: a hashtable with some options (keys and values must be string) + (can be NULL): +** _commands_: a comma-separated list of commands allowed to be executed during + this call; see function <<_string_match_list,string_match_list>> for the + format + +戻り値: + +* _WEECHAT_RC_OK_ 成功した場合 +* _WEECHAT_RC_ERROR_ エラーが起きた場合 + +C 言語での使用例: + +// TRANSLATION MISSING +[source,C] +---- +/* allow any command except /exec */ +int rc; +struct t_hashtable *options = weechat_hashtable_new (8, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, + NULL); +weechat_hashtable_set (options, "commands", "*,!exec"); +rc = weechat_command_options (NULL, "/some_command arguments", options); +---- + +スクリプト (Python) での使用例: + +// TRANSLATION MISSING +[source,python] +---- +# プロトタイプ +weechat.command_options(buffer, command, options) + +# example: allow any command except /exec +rc = weechat.command("", "/some_command arguments", {"commands": "*,!exec"}) +---- + [[network]] === ネットワーク diff --git a/doc/ja/weechat_scripting.ja.adoc b/doc/ja/weechat_scripting.ja.adoc index f37cc2595..9fba9374e 100644 --- a/doc/ja/weechat_scripting.ja.adoc +++ b/doc/ja/weechat_scripting.ja.adoc @@ -570,7 +570,7 @@ link:weechat_plugin_api.ja.html[WeeChat プラグイン API リファレンス] window_get_pointer + window_set_title -| ニックネームリスト | +| ニックネームリスト | nicklist_add_group + nicklist_search_group + nicklist_add_nick + @@ -599,7 +599,8 @@ link:weechat_plugin_api.ja.html[WeeChat プラグイン API リファレンス] bar_remove | コマンド | - command + command + + command_options | インフォ | info_get + diff --git a/doc/pl/weechat_scripting.pl.adoc b/doc/pl/weechat_scripting.pl.adoc index 148118ab3..ff7111c4f 100644 --- a/doc/pl/weechat_scripting.pl.adoc +++ b/doc/pl/weechat_scripting.pl.adoc @@ -466,7 +466,7 @@ Lista funkcji w API skryptów: list_remove_all + list_free -| pliki konfiguracyjne| +| pliki konfiguracyjne | config_new + config_new_section + config_search_section + @@ -504,7 +504,7 @@ Lista funkcji w API skryptów: config_set_desc_plugin + config_unset_plugin -| przypisania klawiszy| +| przypisania klawiszy | key_bind + key_unbind @@ -597,7 +597,8 @@ Lista funkcji w API skryptów: bar_remove | komendy | - command + command + + command_options | informacje | info_get + |