diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 80c7cd33e..eda852036 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -19,6 +19,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === New features +* core: add option "-s" in command /eval to split commands (no more split by + default) (closes #324) * irc: add support of "account-notify" capability (closes #11, closes #246) * irc: remove server "freenode" from default config file (closes #309) * irc: add support of "ecdsa-nist256p-challenge" SASL mechanism (closes #251) diff --git a/po/cs.po b/po/cs.po index 2e8643e18..0627465fa 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -1395,11 +1395,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/de.po b/po/de.po index 7fb40335d..fe9368014 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2015-01-25 18:35+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German <>\n" @@ -1471,11 +1471,14 @@ msgstr "" msgid "evaluate expression" msgstr "evaluierter Ausdruck" -msgid "[-n] || [-n] -c " +#, fuzzy +msgid "[-n|-s] || [-n] -c " msgstr "[-n] || [-n] -c " +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/es.po b/po/es.po index 8b40d5c67..2edbf7ff7 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -1433,11 +1433,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/fr.po b/po/fr.po index adf2def10..eea913762 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: 2015-01-29 07:42+0100\n" -"PO-Revision-Date: 2015-01-29 07:43+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" +"PO-Revision-Date: 2015-01-30 08:26+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -1444,11 +1444,13 @@ msgstr "" msgid "evaluate expression" msgstr "évaluer une expression" -msgid "[-n] || [-n] -c " -msgstr "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " +msgstr "" +"[-n|-s] || [-n] -c " msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " @@ -1518,6 +1520,8 @@ msgid "" " /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n : afficher le résultat sans envoyer au tampon (mode debug)\n" +" -s : découper l'expression (plusieurs commandes peuvent être " +"séparées par des points-virgules)\n" " -c : évaluer comme une condition : utiliser les opérateurs et les " "parenthèses, retourner une valeur booléenne (\"0\" ou \"1\")\n" "expression : expression à évaluer, les variables avec le format ${variable} " diff --git a/po/hu.po b/po/hu.po index 737c06e06..473b2aec7 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1326,11 +1326,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/it.po b/po/it.po index 6cb8329bf..a6ae51f80 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -1412,13 +1412,15 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +#, fuzzy +msgid "[-n|-s] || [-n] -c " msgstr "" "[-n] || [-n] -c " #, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/ja.po b/po/ja.po index 582a4d810..a468b3c66 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2015-01-25 13:54+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -1410,11 +1410,14 @@ msgstr "" msgid "evaluate expression" msgstr "式を評価" -msgid "[-n] || [-n] -c " +#, fuzzy +msgid "[-n|-s] || [-n] -c " msgstr "[-n] || [-n] -c " +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/pl.po b/po/pl.po index 34aaee63b..7547a1579 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-12-26 19:51+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -1447,11 +1447,14 @@ msgstr "" msgid "evaluate expression" msgstr "przetwórz wyrażenie" -msgid "[-n] || [-n] -c " +#, fuzzy +msgid "[-n|-s] || [-n] -c " msgstr "[-n] || [-n] -c " +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/pt_BR.po b/po/pt_BR.po index 718d390fa..99e9d45a0 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -1451,11 +1451,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/ru.po b/po/ru.po index 3c8b08e3f..eae429a37 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-11-09 16:23+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -1348,11 +1348,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/tr.po b/po/tr.po index d1a85f63d..5be8b4365 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -1183,11 +1183,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/po/weechat.pot b/po/weechat.pot index 93c13aba5..368a956d8 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: 2015-01-29 07:42+0100\n" +"POT-Creation-Date: 2015-01-30 08:25+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -1185,11 +1185,12 @@ msgstr "" msgid "evaluate expression" msgstr "" -msgid "[-n] || [-n] -c " +msgid "[-n|-s] || [-n] -c " msgstr "" msgid "" " -n: display result without sending it to buffer (debug mode)\n" +" -s: split expression (many commands can be separated by semicolons)\n" " -c: evaluate as condition: use operators and parentheses, return a " "boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format ${variable} are " diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 9e79d7b91..176642a96 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1815,7 +1815,7 @@ COMMAND_CALLBACK(debug) COMMAND_CALLBACK(eval) { - int i, print_only, condition; + int i, print_only, split_command, condition; char *result, *ptr_args, *expr, **commands; struct t_hashtable *pointers, *options; @@ -1824,6 +1824,7 @@ COMMAND_CALLBACK(eval) (void) argv; print_only = 0; + split_command = 0; condition = 0; COMMAND_MIN_ARGS(2, ""); @@ -1836,6 +1837,11 @@ COMMAND_CALLBACK(eval) print_only = 1; ptr_args = argv_eol[i + 1]; } + else if (string_strcasecmp (argv[i], "-s") == 0) + { + split_command = 1; + ptr_args = argv_eol[i + 1]; + } else if (string_strcasecmp (argv[i], "-c") == 0) { condition = 1; @@ -1906,14 +1912,21 @@ COMMAND_CALLBACK(eval) result = eval_expression (ptr_args, pointers, NULL, options); if (result) { - commands = string_split_command (result, ';'); - if (commands) + if (split_command) { - for (i = 0; commands[i]; i++) + commands = string_split_command (result, ';'); + if (commands) { - (void) input_data (buffer, commands[i]); + for (i = 0; commands[i]; i++) + { + (void) input_data (buffer, commands[i]); + } + string_free_split_command (commands); } - string_free_split_command (commands); + } + else + { + (void) input_data (buffer, result); } } else @@ -7105,8 +7118,12 @@ command_init () hook_command ( NULL, "eval", N_("evaluate expression"), - N_("[-n] || [-n] -c "), - N_(" -n: display result without sending it to buffer (debug mode)\n" + N_("[-n|-s] " + " || [-n] -c "), + N_(" -n: display result without sending it to buffer " + "(debug mode)\n" + " -s: split expression (many commands can be separated by " + "semicolons)\n" " -c: evaluate as condition: use operators and parentheses, " "return a boolean value (\"0\" or \"1\")\n" "expression: expression to evaluate, variables with format " @@ -7178,7 +7195,7 @@ command_init () " /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" " /eval -n -c abcd =~ (?-i)^abc ==> 1\n" " /eval -n -c abcd !~ abc ==> 0"), - "-n|-c -n|-c", + "-n|-s|-c -n|-s|-c", &command_eval, NULL); hook_command ( NULL, "filter",