1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

script: add option "search" for command /script (completion with script tags)

This commit is contained in:
Sebastien Helleu
2012-08-18 09:01:26 +02:00
parent 5ae6f133d6
commit 13b1d64aa1
25 changed files with 323 additions and 143 deletions
+15 -1
View File
@@ -102,6 +102,16 @@ script_command_script (void *data, struct t_gui_buffer *buffer, int argc,
return WEECHAT_RC_OK;
}
if (weechat_strcasecmp (argv[1], "search") == 0)
{
if (repo_scripts)
script_repo_filter_scripts ((argc > 2) ? argv_eol[2] : NULL);
else
script_repo_set_filter ((argc > 2) ? argv_eol[2] : NULL);
script_action_schedule ("buffer", 1, 0);
return WEECHAT_RC_OK;
}
if (weechat_strcasecmp (argv[1], "list") == 0)
{
script_action_schedule ("list", 1, 0);
@@ -214,11 +224,13 @@ script_command_init ()
{
weechat_hook_command ("script",
N_("WeeChat scripts manager"),
N_("list || show <script>"
N_("list || search <text> || show <script>"
" || load|unload|reload <script> [<script>...]"
" || install|remove|hold <script> [<script>...]"
" || upgrade || update"),
N_(" list: list loaded scripts (all languages)\n"
" search: search scripts by tags or text and "
"display result on scripts buffer\n"
" show: show detailed info about a script\n"
" load: load script(s)\n"
" unload: unload script(s)\n"
@@ -259,12 +271,14 @@ script_command_init ()
"scripts (description, tags, ...)\n"
" * remove filter\n\n"
"Examples:\n"
" /script search url\n"
" /script install iset.pl buffers.pl\n"
" /script remove iset.pl\n"
" /script hold urlserver.py\n"
" /script reload urlserver\n"
" /script upgrade"),
"list"
" || search %(script_tags)"
" || show %(script_scripts)"
" || load %(script_files)|%*"
" || unload %(python_script)|%(perl_script)|"