diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 7d70ece60..1b34078ae 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] New features:: + * core: use seconds by default in /repeat interval, allow unit for the interval * core: allow text in addition to a command in command /repeat * core: add option "addreplace" in command /filter (issue #1055, issue #1312) * api: replace argument "keep_eol" by "flags" in function string_split (issue #1322) diff --git a/doc/de/autogen/user/weechat_commands.adoc b/doc/de/autogen/user/weechat_commands.adoc index 0c284ec33..b5512f7e6 100644 --- a/doc/de/autogen/user/weechat_commands.adoc +++ b/doc/de/autogen/user/weechat_commands.adoc @@ -755,9 +755,14 @@ Ohne Angabe von Argumenten werden alle Konfigurationen (WeeChat und Erweiterunge * `+repeat+`: führt einen Befehl mehrfach aus ---- -/repeat [-interval ] +/repeat [-interval []] - delay: delay between execution of commands (in milliseconds) + delay: delay between execution of commands + unit: optional, values are: + ms: milliseconds + s: seconds (default) + m: minutes + h: hours count: number of times to execute command command: command to execute (or text to send to buffer if command does not start with '/') diff --git a/doc/en/autogen/user/weechat_commands.adoc b/doc/en/autogen/user/weechat_commands.adoc index d1dbf186a..dc5bde05e 100644 --- a/doc/en/autogen/user/weechat_commands.adoc +++ b/doc/en/autogen/user/weechat_commands.adoc @@ -755,9 +755,14 @@ Without argument, all files (WeeChat and plugins) are reloaded. * `+repeat+`: execute a command several times ---- -/repeat [-interval ] +/repeat [-interval []] - delay: delay between execution of commands (in milliseconds) + delay: delay between execution of commands + unit: optional, values are: + ms: milliseconds + s: seconds (default) + m: minutes + h: hours count: number of times to execute command command: command to execute (or text to send to buffer if command does not start with '/') diff --git a/doc/fr/autogen/user/weechat_commands.adoc b/doc/fr/autogen/user/weechat_commands.adoc index e1530be35..6ffd92c6a 100644 --- a/doc/fr/autogen/user/weechat_commands.adoc +++ b/doc/fr/autogen/user/weechat_commands.adoc @@ -755,9 +755,14 @@ Sans paramètre, tous les fichiers (WeeChat et extensions) sont rechargés. * `+repeat+`: exécuter une commande plusieurs fois ---- -/repeat [-interval ] +/repeat [-interval []] - délai : délai entre l'exécution des commandes (en millisecondes) + délai : délai entre l'exécution des commandes + unité : optionnelle, valeurs possibles : + ms : millisecondes + s : secondes (par défaut) + m : minutes + h : heures nombre : nombre de fois que la commande sera exécutée commande : commande à exécuter (ou texte à envoyer au tampon si la commande ne commence pas par '/') diff --git a/doc/it/autogen/user/weechat_commands.adoc b/doc/it/autogen/user/weechat_commands.adoc index 0a2d74b71..f32eedf29 100644 --- a/doc/it/autogen/user/weechat_commands.adoc +++ b/doc/it/autogen/user/weechat_commands.adoc @@ -755,9 +755,14 @@ Senza argomento, vengono ricaricati tutti i file (WeeChat e plugin). * `+repeat+`: esegue un comando più volte ---- -/repeat [-interval ] +/repeat [-interval []] - delay: delay between execution of commands (in milliseconds) + delay: delay between execution of commands + unit: optional, values are: + ms: milliseconds + s: seconds (default) + m: minutes + h: hours count: number of times to execute command command: command to execute (or text to send to buffer if command does not start with '/') diff --git a/doc/ja/autogen/user/weechat_commands.adoc b/doc/ja/autogen/user/weechat_commands.adoc index 17d62b16d..5ac4e4313 100644 --- a/doc/ja/autogen/user/weechat_commands.adoc +++ b/doc/ja/autogen/user/weechat_commands.adoc @@ -755,9 +755,14 @@ file: リロードする設定ファイル (拡張子 ".conf" は不要) * `+repeat+`: 複数回コマンドを実行 ---- -/repeat [-interval ] +/repeat [-interval []] - delay: delay between execution of commands (in milliseconds) + delay: delay between execution of commands + unit: optional, values are: + ms: milliseconds + s: seconds (default) + m: minutes + h: hours count: number of times to execute command command: command to execute (or text to send to buffer if command does not start with '/') diff --git a/doc/pl/autogen/user/weechat_commands.adoc b/doc/pl/autogen/user/weechat_commands.adoc index d6f30ba99..f05f84b0b 100644 --- a/doc/pl/autogen/user/weechat_commands.adoc +++ b/doc/pl/autogen/user/weechat_commands.adoc @@ -755,9 +755,14 @@ Bez podania argumentu wszystkie pliki (WeeChat oraz wtyczki) zostaną przeładow * `+repeat+`: wykonuje komendę kilka razy ---- -/repeat [-interval ] +/repeat [-interval []] - delay: delay between execution of commands (in milliseconds) + delay: delay between execution of commands + unit: optional, values are: + ms: milliseconds + s: seconds (default) + m: minutes + h: hours count: number of times to execute command command: command to execute (or text to send to buffer if command does not start with '/') diff --git a/po/cs.po b/po/cs.po index 024d37f46..78ac4785f 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-17 18:32+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -2289,12 +2289,18 @@ msgstr "" msgid "execute a command several times" msgstr "vykonat příkaz v tichosti" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/de.po b/po/de.po index 13fddfbf3..dcdbe4831 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-21 23:31+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -2719,12 +2719,18 @@ msgstr "" msgid "execute a command several times" msgstr "führt einen Befehl mehrfach aus" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/es.po b/po/es.po index d7a966aeb..85d7b73bc 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-17 16:04+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -2391,12 +2391,18 @@ msgstr "" msgid "execute a command several times" msgstr "ejecuta un comando varias veces" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/fr.po b/po/fr.po index a7b465cba..05b6624d1 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" -"PO-Revision-Date: 2019-03-29 08:37+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" +"PO-Revision-Date: 2019-03-29 20:30+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -2651,11 +2651,16 @@ msgstr "" msgid "execute a command several times" msgstr "exécuter une commande plusieurs fois" -msgid "[-interval ] " -msgstr "[-interval ] " +msgid "[-interval []] " +msgstr "[-interval []] " msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" @@ -2666,7 +2671,12 @@ msgid "" " scroll 2 pages up:\n" " /repeat 2 /window page_up" msgstr "" -" délai : délai entre l'exécution des commandes (en millisecondes)\n" +" délai : délai entre l'exécution des commandes\n" +" unité : optionnelle, valeurs possibles :\n" +" ms : millisecondes\n" +" s : secondes (par défaut)\n" +" m : minutes\n" +" h : heures\n" " nombre : nombre de fois que la commande sera exécutée\n" "commande : commande à exécuter (ou texte à envoyer au tampon si la commande " "ne commence pas par '/')\n" diff --git a/po/hu.po b/po/hu.po index d4587b49a..78e3b1d77 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-02-28 20:18+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -2028,12 +2028,18 @@ msgstr "" msgid "execute a command several times" msgstr "%s belső parancsok:\n" -msgid "[-interval ] " -msgstr "" +#, fuzzy +msgid "[-interval []] " +msgstr "Modul parancsok:\n" #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/it.po b/po/it.po index 115c4dbb6..b2f56f520 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-17 16:04+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -2434,12 +2434,18 @@ msgstr "" msgid "execute a command several times" msgstr "esegue un comando più volte" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/ja.po b/po/ja.po index 8c2dfa823..971dbf1d4 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-21 23:32+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/pl.po b/po/pl.po index 9bd7aa093..ea2b1cbf3 100644 --- a/po/pl.po +++ b/po/pl.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-21 23:32+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: Polish \n" @@ -2628,12 +2628,18 @@ msgstr "" msgid "execute a command several times" msgstr "wykonuje komendę kilka razy" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/pt.po b/po/pt.po index 70ae2d2fd..051c91113 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-21 23:33+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -2584,12 +2584,18 @@ msgstr "" msgid "execute a command several times" msgstr "executar um comando várias vezes" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 76a1651d0..4c38bdacf 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-11 21:10+0100\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -2417,12 +2417,18 @@ msgstr "" msgid "execute a command several times" msgstr "executa um comando várias vezes" -msgid "[-interval ] " +#, fuzzy +msgid "[-interval []] " msgstr "[-interval ] " #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/ru.po b/po/ru.po index ed4a5320c..319e72ca5 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-11 21:10+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -2051,12 +2051,18 @@ msgstr "" msgid "execute a command several times" msgstr "Внутренние команды %s:\n" -msgid "[-interval ] " -msgstr "" +#, fuzzy +msgid "[-interval []] " +msgstr "Команды Plugin'ов:\n" #, fuzzy msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/tr.po b/po/tr.po index 7453752b6..acb986cad 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2019-03-17 16:04+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -1849,11 +1849,17 @@ msgstr "" msgid "execute a command several times" msgstr "" -msgid "[-interval ] " -msgstr "" +#, fuzzy +msgid "[-interval []] " +msgstr " " msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/po/weechat.pot b/po/weechat.pot index 31981a4d7..aa0d6472a 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2019-03-29 07:53+0100\n" +"POT-Creation-Date: 2019-03-29 20:28+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -1848,11 +1848,16 @@ msgstr "" msgid "execute a command several times" msgstr "" -msgid "[-interval ] " +msgid "[-interval []] " msgstr "" msgid "" -" delay: delay between execution of commands (in milliseconds)\n" +" delay: delay between execution of commands\n" +" unit: optional, values are:\n" +" ms: milliseconds\n" +" s: seconds (default)\n" +" m: minutes\n" +" h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command does not " "start with '/')\n" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 325e24753..dc92ca8ea 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -5250,7 +5250,8 @@ command_repeat_timer_cb (const void *pointer, void *data, int remaining_calls) COMMAND_CALLBACK(repeat) { - int arg_count, count, interval, i; + int arg_count, count, i; + long interval; char *error, **repeat_args; /* make C compiler happy */ @@ -5264,9 +5265,8 @@ COMMAND_CALLBACK(repeat) if ((argc >= 5) && (string_strcasecmp (argv[1], "-interval") == 0)) { - error = NULL; - interval = (int)strtol (argv[2], &error, 10); - if (!error || error[0] || (interval < 1)) + interval = util_parse_delay (argv[2], 1000); + if (interval < 1) interval = 0; arg_count = 3; } @@ -7906,8 +7906,13 @@ command_init () hook_command ( NULL, "repeat", N_("execute a command several times"), - N_("[-interval ] "), - N_(" delay: delay between execution of commands (in milliseconds)\n" + N_("[-interval []] "), + N_(" delay: delay between execution of commands\n" + " unit: optional, values are:\n" + " ms: milliseconds\n" + " s: seconds (default)\n" + " m: minutes\n" + " h: hours\n" " count: number of times to execute command\n" "command: command to execute (or text to send to buffer if command " "does not start with '/')\n"