summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-09-09 18:14:09 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-10-17 18:14:54 +0200
commitefa1f44317896fb4f6da4dd977d25b2c5fd07d45 (patch)
tree7a3ce7e0e25e237f404e47a5534acf7c5254f06c /src
parentd60859138fd14f99ba49239f3d8c696d1f279221 (diff)
downloadweechat-efa1f44317896fb4f6da4dd977d25b2c5fd07d45.zip
script: format and translate commands line by line (issue #2005)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugin-script.c43
-rw-r--r--src/plugins/script/script-command.c150
2 files changed, 83 insertions, 110 deletions
diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c
index c9ac37be3..5737950f3 100644
--- a/src/plugins/plugin-script.c
+++ b/src/plugins/plugin-script.c
@@ -201,27 +201,28 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin,
" || reload|unload [-q] [<name>]"
" || eval [-o|-oc] <code>"
" || version"),
- N_(" list: list loaded scripts\n"
- "listfull: list loaded scripts (verbose)\n"
- " load: load a script\n"
- "autoload: load all scripts in \"autoload\" directory\n"
- " reload: reload a script (if no name given, unload all scripts, "
- "then load all scripts in \"autoload\" directory)\n"
- " unload: unload a script (if no name given, unload all scripts)\n"
- "filename: script (file) to load\n"
- " -q: quiet mode: do not display messages\n"
- " name: a script name (name used in call to \"register\" "
- "function)\n"
- " eval: evaluate source code and display result on current "
- "buffer\n"
- " -o: send evaluation result to the buffer without executing "
- "commands\n"
- " -oc: send evaluation result to the buffer and execute "
- "commands\n"
- " code: source code to evaluate\n"
- " version: display the version of interpreter used\n"
- "\n"
- "Without argument, this command lists all loaded scripts."),
+ WEECHAT_CMD_ARGS_DESC(
+ N_("raw[list]: list loaded scripts"),
+ N_("raw[listfull]: list loaded scripts (verbose)"),
+ N_("raw[load]: load a script"),
+ N_("raw[autoload]: load all scripts in \"autoload\" directory"),
+ N_("raw[reload]: reload a script (if no name given, unload all scripts, "
+ "then load all scripts in \"autoload\" directory)"),
+ N_("raw[unload]: unload a script (if no name given, unload all scripts)"),
+ N_("filename: script (file) to load"),
+ N_("raw[-q]: quiet mode: do not display messages"),
+ N_("name: a script name (name used in call to \"register\" "
+ "function)"),
+ N_("raw[eval]: evaluate source code and display result on current "
+ "buffer"),
+ N_("raw[-o]: send evaluation result to the buffer without executing "
+ "commands"),
+ N_("raw[-oc]: send evaluation result to the buffer and execute "
+ "commands"),
+ N_("code: source code to evaluate"),
+ N_("raw[version]: display the version of interpreter used"),
+ "",
+ N_("Without argument, this command lists all loaded scripts.")),
completion,
plugin_data->callback_command, NULL, NULL);
if (completion)
diff --git a/src/plugins/script/script-command.c b/src/plugins/script/script-command.c
index 96ef216f1..332e4e07d 100644
--- a/src/plugins/script/script-command.c
+++ b/src/plugins/script/script-command.c
@@ -319,95 +319,67 @@ script_command_init ()
" || update"
" || -up|-down [<number>]"
" || -go <line>|end"),
- N_(" list: list loaded scripts (all languages)\n"
- " -o: send list of loaded scripts to buffer "
- "(string in English)\n"
- " -ol: send list of loaded scripts to buffer "
- "(translated string)\n"
- " -i: copy list of loaded scripts in command line (for "
- "sending to buffer) (string in English)\n"
- " -il: copy list of loaded scripts in command line (for "
- "sending to buffer) (translated string)\n"
- " search: search scripts by tags, language (python, "
- "perl, ...), filename extension (py, pl, ...) or text; result is "
- "displayed on scripts buffer\n"
- " show: show detailed info about a script\n"
- " load: load script(s)\n"
- " unload: unload script(s)\n"
- " reload: reload script(s)\n"
- " autoload: autoload the script\n"
- " noautoload: do not autoload the script\n"
- "toggleautoload: toggle autoload\n"
- " install: install/upgrade script(s)\n"
- " remove: remove script(s)\n"
- " installremove: install or remove script(s), depending on current "
- "state\n"
- " hold: hold/unhold script(s) (a script held will not be "
- "upgraded any more and cannot be removed)\n"
- " -q: quiet mode: do not display messages\n"
- " upgrade: upgrade all installed scripts which are obsolete "
- "(new version available)\n"
- " update: update local scripts cache\n"
- " -up: move the selected line up by \"number\" lines\n"
- " -down: move the selected line down by \"number\" lines\n"
- " -go: select a line by number, first line number is 0 "
- "(\"end\" to select the last line)\n"
- "\n"
- "Without argument, this command opens a buffer with list of scripts.\n"
- "\n"
- "On script buffer, the possible status for each script are:\n"
- " * i a H r N\n"
- " | | | | | |\n"
- " | | | | | obsolete (new version available)\n"
- " | | | | running (loaded)\n"
- " | | | held\n"
- " | | autoloaded\n"
- " | installed\n"
- " popular script\n"
- "\n"
- "In output of /script list, the possible status for each script are:\n"
- " * ? i a H N\n"
- " | | | | | |\n"
- " | | | | | obsolete (new version available)\n"
- " | | | | held\n"
- " | | | autoloaded\n"
- " | | installed\n"
- " | unknown script (can not be downloaded/updated)\n"
- " popular script\n"
- "\n"
- "Keys on script buffer:\n"
- " alt+i install script\n"
- " alt+r remove script\n"
- " alt+l load script\n"
- " alt+L reload script\n"
- " alt+u unload script\n"
- " alt+A autoload script\n"
- " alt+h (un)hold script\n"
- " alt+v view script\n"
- "\n"
- "Input allowed on script buffer:\n"
- " i/r/l/L/u/A/h/v action on script (same as keys above)\n"
- " q close buffer\n"
- " $ refresh buffer\n"
- " s:x,y sort buffer using keys x and y (see /help "
- "script.look.sort)\n"
- " s: reset sort (use default sort)\n"
- " word(s) filter scripts: search word(s) in scripts "
- "(description, tags, ...)\n"
- " * remove filter\n"
- "\n"
- "Mouse actions on script buffer:\n"
- " wheel scroll list\n"
- " left button select script\n"
- " right button install/remove script\n"
- "\n"
- "Examples:\n"
- " /script search url\n"
- " /script install go.py urlserver.py\n"
- " /script remove go.py\n"
- " /script hold urlserver.py\n"
- " /script reload urlserver\n"
- " /script upgrade"),
+ WEECHAT_CMD_ARGS_DESC(
+ N_("raw[list]: list loaded scripts (all languages)"),
+ N_("raw[-o]: send list of loaded scripts to buffer "
+ "(string in English)"),
+ N_("raw[-ol]: send list of loaded scripts to buffer "
+ "(translated string)"),
+ N_("raw[-i]: copy list of loaded scripts in command line (for "
+ "sending to buffer) (string in English)"),
+ N_("raw[-il]: copy list of loaded scripts in command line (for "
+ "sending to buffer) (translated string)"),
+ N_("raw[search]: search scripts by tags, language (python, "
+ "perl, ...), filename extension (py, pl, ...) or text; result is "
+ "displayed on scripts buffer"),
+ N_("raw[show]: show detailed info about a script"),
+ N_("raw[load]: load script(s)"),
+ N_("raw[unload]: unload script(s)"),
+ N_("raw[reload]: reload script(s)"),
+ N_("raw[autoload]: autoload the script"),
+ N_("raw[noautoload]: do not autoload the script"),
+ N_("raw[toggleautoload]: toggle autoload"),
+ N_("raw[install]: install/upgrade script(s)"),
+ N_("raw[remove]: remove script(s)"),
+ N_("raw[installremove]: install or remove script(s), depending on current "
+ "state"),
+ N_("raw[hold]: hold/unhold script(s) (a script held will not be "
+ "upgraded any more and cannot be removed)"),
+ N_("raw[-q]: quiet mode: do not display messages"),
+ N_("raw[upgrade]: upgrade all installed scripts which are obsolete "
+ "(new version available)"),
+ N_("raw[update]: update local scripts cache"),
+ N_("raw[-up]: move the selected line up by \"number\" lines"),
+ N_("raw[-down]: move the selected line down by \"number\" lines"),
+ N_("raw[-go]: select a line by number, first line number is 0 "
+ "(\"end\" to select the last line)"),
+ "",
+ N_("Without argument, this command opens a buffer with list of scripts."),
+ "",
+ N_("On script buffer, the possible status for each script are:"),
+ N_(" `*`: popular script"),
+ N_(" `i`: installed"),
+ N_(" `a`: autoloaded"),
+ N_(" `H`: held"),
+ N_(" `r`: running (loaded)"),
+ N_(" `N`: obsolete (new version available)"),
+ "",
+ N_("In output of /script list, this additional status can be displayed:"),
+ N_(" `?`: unknown script (can not be downloaded/updated)"),
+ "",
+ N_("In input of script buffer, word(s) are used to filter scripts "
+ "on description, tags, ...). The input \"*\" removes the filter."),
+ "",
+ N_("For keys, input and mouse actions on the buffer, "
+ "see key bindings in User's guide."),
+ "",
+ N_("Examples:"),
+ AI(" /script search url"),
+ AI(" /script install go.py urlserver.py"),
+ AI(" /script remove go.py"),
+ AI(" /script hold urlserver.py"),
+ AI(" /script reload urlserver"),
+ AI(" /script upgrade")),
"list -i|-il|-o|-ol"
" || search %(script_tags)|%(script_languages)|%(script_extensions)"
" || show %(script_scripts)"