1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

script: add options -o and -i for /script list

This commit is contained in:
Sebastien Helleu
2012-08-21 21:42:34 +02:00
parent 129f32ce8e
commit 09f80c20d6
18 changed files with 161 additions and 45 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
[[command_script_script]]
[command]*`script`* WeeChat scripts manager::
........................................
/script list
/script list [-o|-i]
search <text>
show <script>
load|unload|reload <script> [<script>...]
@@ -10,6 +10,8 @@
update
list: list loaded scripts (all languages)
-o: send list of loaded scripts to buffer
-i: copy list of loaded scripts in command line (for sending to buffer)
search: search scripts by tags or text and display result on scripts buffer
show: show detailed info about a script
load: load script(s)
+3 -1
View File
@@ -1,7 +1,7 @@
[[command_script_script]]
[command]*`script`* WeeChat scripts manager::
........................................
/script list
/script list [-o|-i]
search <text>
show <script>
load|unload|reload <script> [<script>...]
@@ -10,6 +10,8 @@
update
list: list loaded scripts (all languages)
-o: send list of loaded scripts to buffer
-i: copy list of loaded scripts in command line (for sending to buffer)
search: search scripts by tags or text and display result on scripts buffer
show: show detailed info about a script
load: load script(s)
+3 -1
View File
@@ -1,7 +1,7 @@
[[command_script_script]]
[command]*`script`* Gestionnaire de scripts WeeChat::
........................................
/script list
/script list [-o|-i]
search <texte>
show <script>
load|unload|reload <script> [<script>...]
@@ -10,6 +10,8 @@
update
list: lister les scripts chargés (tous les langages)
-o: envoyer la liste des scripts chargés au tampon
-i: copier la liste des scripts chargés dans la ligne de commande (pour envoi au tampon)
search: chercher des scripts par étiquettes ou texte et afficher le résultat sur le tampon des scripts
show: afficher des infos détaillées sur le script
load: charger un ou plusieurs scripts
+3 -1
View File
@@ -1,7 +1,7 @@
[[command_script_script]]
[command]*`script`* WeeChat scripts manager::
........................................
/script list
/script list [-o|-i]
search <text>
show <script>
load|unload|reload <script> [<script>...]
@@ -10,6 +10,8 @@
update
list: list loaded scripts (all languages)
-o: send list of loaded scripts to buffer
-i: copy list of loaded scripts in command line (for sending to buffer)
search: search scripts by tags or text and display result on scripts buffer
show: show detailed info about a script
load: load script(s)
+3 -1
View File
@@ -1,7 +1,7 @@
[[command_script_script]]
[command]*`script`* WeeChat scripts manager::
........................................
/script list
/script list [-o|-i]
search <text>
show <script>
load|unload|reload <script> [<script>...]
@@ -10,6 +10,8 @@
update
list: list loaded scripts (all languages)
-o: send list of loaded scripts to buffer
-i: copy list of loaded scripts in command line (for sending to buffer)
search: search scripts by tags or text and display result on scripts buffer
show: show detailed info about a script
load: load script(s)
+6 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8332,13 +8332,16 @@ msgid "WeeChat scripts manager"
msgstr "stránka WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -8904,13 +8904,16 @@ msgid "WeeChat scripts manager"
msgstr "WeeChat Seite"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8605,13 +8605,16 @@ msgid "WeeChat scripts manager"
msgstr "sitio web de WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+12 -6
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"PO-Revision-Date: 2012-08-21 18:38+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-21 21:18+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -8685,16 +8685,19 @@ msgid "WeeChat scripts manager"
msgstr "Gestionnaire de scripts WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
"list || search <texte> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <texte> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
@@ -8755,6 +8758,9 @@ msgid ""
" /script upgrade"
msgstr ""
" list: lister les scripts chargés (tous les langages)\n"
" -o: envoyer la liste des scripts chargés au tampon\n"
" -i: copier la liste des scripts chargés dans la ligne de commande "
"(pour envoi au tampon)\n"
" search: chercher des scripts par étiquettes ou texte et afficher le "
"résultat sur le tampon des scripts\n"
" show: afficher des infos détaillées sur le script\n"
+6 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7811,13 +7811,16 @@ msgid "WeeChat scripts manager"
msgstr "WeeChat szlogen"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8595,13 +8595,16 @@ msgid "WeeChat scripts manager"
msgstr "sito di WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@@ -8394,13 +8394,16 @@ msgid "WeeChat scripts manager"
msgstr "WeeChat サイト"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8528,13 +8528,16 @@ msgid "WeeChat scripts manager"
msgstr "Strona WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7962,13 +7962,16 @@ msgid "WeeChat scripts manager"
msgstr "site do WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: 2012-08-20 15:20+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7834,13 +7834,16 @@ msgid "WeeChat scripts manager"
msgstr "слоган WeeChat"
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+6 -3
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-08-21 18:49+0200\n"
"POT-Creation-Date: 2012-08-21 21:36+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -6886,13 +6886,16 @@ msgid "WeeChat scripts manager"
msgstr ""
msgid ""
"list || search <text> || show <script> || load|unload|reload <script> "
"[<script>...] || install|remove|installremove|hold [-q] <script> "
"list [-o|-i] || search <text> || show <script> || load|unload|reload "
"<script> [<script>...] || install|remove|installremove|hold [-q] <script> "
"[<script>...] || upgrade || update"
msgstr ""
msgid ""
" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in command line (for sending to "
"buffer)\n"
" search: search scripts by tags or text and display result on scripts "
"buffer\n"
" show: show detailed info about a script\n"
+68 -1
View File
@@ -91,6 +91,63 @@ script_action_list ()
}
}
/*
* script_action_list_input: list loaded scripts (all languages) in input
* (send it to buffer if send_to_buffer == 1)
*/
void
script_action_list_input (int send_to_buffer)
{
int i, length;
char hdata_name[128], *buf, str_pos[16];
struct t_hdata *hdata;
void *ptr_script;
buf = malloc (16384);
if (!buf)
return;
buf[0] = '\0';
length = 0;
for (i = 0; script_language[i]; i++)
{
snprintf (hdata_name, sizeof (hdata_name),
"%s_script", script_language[i]);
hdata = weechat_hdata_get (hdata_name);
ptr_script = weechat_hdata_get_list (hdata, "scripts");
while (ptr_script)
{
if (buf[0])
strcat (buf, ", ");
strcat (buf, weechat_hdata_string (hdata, ptr_script, "name"));
strcat (buf, " ");
strcat (buf, weechat_hdata_string (hdata, ptr_script, "version"));
length = strlen (buf);
if (length > 16384 - 64)
{
strcat (buf, "...");
length += 3;
break;
}
ptr_script = weechat_hdata_move (hdata, ptr_script, 1);
}
}
if (buf[0])
{
if (send_to_buffer)
weechat_command (weechat_current_buffer (), buf);
else
{
weechat_buffer_set (weechat_current_buffer (), "input", buf);
snprintf (str_pos, sizeof (str_pos), "%d", length);
weechat_buffer_set (weechat_current_buffer (), "input_pos", str_pos);
}
}
}
/*
* script_action_load: load a script
*/
@@ -687,7 +744,17 @@ script_action_run ()
}
else if (weechat_strcasecmp (argv[0], "list") == 0)
{
script_action_list ();
if (argc > 1)
{
if (weechat_strcasecmp (argv[1], "-i") == 0)
script_action_list_input (0);
else if (weechat_strcasecmp (argv[1], "-o") == 0)
script_action_list_input (1);
else
script_action_list ();
}
else
script_action_list ();
}
else if (weechat_strcasecmp (argv[0], "load") == 0)
{
+6 -3
View File
@@ -164,7 +164,7 @@ script_command_script (void *data, struct t_gui_buffer *buffer, int argc,
if (weechat_strcasecmp (argv[1], "list") == 0)
{
script_action_schedule ("list", 1, 0);
script_action_schedule (argv_eol[1], 1, 0);
return WEECHAT_RC_OK;
}
@@ -275,11 +275,14 @@ script_command_init ()
{
weechat_hook_command ("script",
N_("WeeChat scripts manager"),
N_("list || search <text> || show <script>"
N_("list [-o|-i] || search <text> || show <script>"
" || load|unload|reload <script> [<script>...]"
" || install|remove|installremove|hold [-q] <script> [<script>...]"
" || upgrade || update"),
N_(" list: list loaded scripts (all languages)\n"
" -o: send list of loaded scripts to buffer\n"
" -i: copy list of loaded scripts in "
"command line (for sending to buffer)\n"
" search: search scripts by tags or text and "
"display result on scripts buffer\n"
" show: show detailed info about a script\n"
@@ -337,7 +340,7 @@ script_command_init ()
" /script hold urlserver.py\n"
" /script reload urlserver\n"
" /script upgrade"),
"list"
"list -o|-i"
" || search %(script_tags)"
" || show %(script_scripts)"
" || load %(script_files)|%*"