From 652ec2444996580bfcabcb9583f85d77aaad555a Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 17 Feb 2014 11:12:36 +0100 Subject: [PATCH] core: allow empty arguments for command /print --- ChangeLog | 3 ++- doc/de/autogen/user/weechat_commands.txt | 4 ++-- doc/en/autogen/user/weechat_commands.txt | 4 ++-- doc/fr/autogen/user/weechat_commands.txt | 4 ++-- doc/it/autogen/user/weechat_commands.txt | 4 ++-- doc/ja/autogen/user/weechat_commands.txt | 4 ++-- doc/pl/autogen/user/weechat_commands.txt | 4 ++-- po/cs.po | 4 ++-- po/de.po | 5 +++-- po/es.po | 4 ++-- po/fr.po | 10 +++++----- po/hu.po | 4 ++-- po/it.po | 4 ++-- po/ja.po | 5 +++-- po/pl.po | 5 +++-- po/pt_BR.po | 4 ++-- po/ru.po | 4 ++-- po/tr.po | 4 ++-- po/weechat.pot | 4 ++-- src/core/wee-command.c | 14 ++++---------- 20 files changed, 48 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b9a3732b..94ddf6b1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,8 +11,9 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] (file 'NEWS' in sources). -== Version 0.4.4 (under dev!) +== Version 0.4.4 (under dev) +* core: allow empty arguments for command /print * core: add bare display mode (for easy text selection and click on URLs), new key: key[alt-!], new option "bare" in command /window, new options: weechat.look.bare_display_exit_on_input and diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index ced40429c..173f5aad4 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -565,8 +565,8 @@ Ohne Angabe eines Arguments werden alle installierten Erweiterungen angezeigt. [command]*`print`* gibt einen Text:: ---- -/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] - -stdout|-stderr +/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] [] + -stdout|-stderr [] -buffer: Buffer in welchem der Text ausgegeben werden soll (standardmäßig: aktueller Buffer) -core: Alias für "-buffer core.weechat" diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt index dc01d6dd1..6954e9e3e 100644 --- a/doc/en/autogen/user/weechat_commands.txt +++ b/doc/en/autogen/user/weechat_commands.txt @@ -565,8 +565,8 @@ Without argument, this command lists loaded plugins. [command]*`print`* display text on a buffer:: ---- -/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] - -stdout|-stderr +/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] [] + -stdout|-stderr [] -buffer: the buffer where text is displayed (default: current buffer) -core: alias of "-buffer core.weechat" diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt index 497403da0..32da20aee 100644 --- a/doc/fr/autogen/user/weechat_commands.txt +++ b/doc/fr/autogen/user/weechat_commands.txt @@ -565,8 +565,8 @@ Sans paramètre, cette commande liste les extensions chargées. [command]*`print`* afficher du texte dans un tampon:: ---- -/print [-buffer |] [-core] [-escape] [-date ] [-tags <étiquettes>] [-action|-error|-join|-network|-quit] - -stdout|-stderr +/print [-buffer |] [-core] [-escape] [-date ] [-tags <étiquettes>] [-action|-error|-join|-network|-quit] [] + -stdout|-stderr [] -buffer: le tampon où est affiché le texte (par défaut: tampon courant) -core: alias de "-buffer core.weechat" diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt index 60322fc99..03a3038ab 100644 --- a/doc/it/autogen/user/weechat_commands.txt +++ b/doc/it/autogen/user/weechat_commands.txt @@ -565,8 +565,8 @@ Senza argomento, questo comando elenca i plugin caricati. [command]*`print`* display text on a buffer:: ---- -/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] - -stdout|-stderr +/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] [] + -stdout|-stderr [] -buffer: the buffer where text is displayed (default: current buffer) -core: alias of "-buffer core.weechat" diff --git a/doc/ja/autogen/user/weechat_commands.txt b/doc/ja/autogen/user/weechat_commands.txt index 8f617cc01..fbf96b67a 100644 --- a/doc/ja/autogen/user/weechat_commands.txt +++ b/doc/ja/autogen/user/weechat_commands.txt @@ -565,8 +565,8 @@ arguments: ロードするプラグインに与える引数 [command]*`print`* バッファ内にテキストを表示:: ---- -/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] - -stdout|-stderr +/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] [] + -stdout|-stderr [] -buffer: テキストを表示するバッファ (デフォルト: 現在のバッファ) -core: "-buffer core.weechat" のエイリアス diff --git a/doc/pl/autogen/user/weechat_commands.txt b/doc/pl/autogen/user/weechat_commands.txt index 4860f1c08..e1a12447e 100644 --- a/doc/pl/autogen/user/weechat_commands.txt +++ b/doc/pl/autogen/user/weechat_commands.txt @@ -565,8 +565,8 @@ Bez argumentów ta komenda wyświetli wszystkie załadowane wtyczki. [command]*`print`* wyświetl tekst w buforze:: ---- -/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] - -stdout|-stderr +/print [-buffer |] [-core] [-escape] [-date ] [-tags ] [-action|-error|-join|-network|-quit] [] + -stdout|-stderr [] -buffer: bufor, w którym zostanie wyświetlony tekst (domyślnie: obecny bufor) -core: alias dla bufora "-buffer core.weechat" diff --git a/po/cs.po b/po/cs.po index 7e3132b71..9f45578e8 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -1868,7 +1868,7 @@ msgstr "barva textu pro jeméno bufferu" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/de.po b/po/de.po index 91265b107..76790a652 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -2099,9 +2099,10 @@ msgstr "" msgid "display text on a buffer" msgstr "gibt einen Text" +#, fuzzy msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" "action|-error|-join|-network|-quit] || -stdout|-stderr " diff --git a/po/es.po b/po/es.po index c99efa7f0..5e0351066 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -1973,7 +1973,7 @@ msgstr "color del texto en el buffer del repetidor" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/fr.po b/po/fr.po index f8549325a..ed9048b57 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: 2014-02-16 10:12+0100\n" -"PO-Revision-Date: 2014-02-16 11:21+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" +"PO-Revision-Date: 2014-02-17 11:10+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -2049,11 +2049,11 @@ msgstr "afficher du texte dans un tampon" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" "[-buffer |] [-core] [-escape] [-date ] [-tags " -"<étiquettes>] [-action|-error|-join|-network|-quit] || -stdout|-" -"stderr " +"<étiquettes>] [-action|-error|-join|-network|-quit] [] || -stdout|-" +"stderr []" msgid "" "-buffer: the buffer where text is displayed (default: current buffer)\n" diff --git a/po/hu.po b/po/hu.po index 4bbd4a7a0..efb08f6f7 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1649,7 +1649,7 @@ msgstr "szerver nevének színe" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/it.po b/po/it.po index 9c0d3ce16..6040c779c 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -2011,7 +2011,7 @@ msgstr "colore del testo nei buffer relay" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/ja.po b/po/ja.po index f501797d9..4e5001af8 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -1993,9 +1993,10 @@ msgstr "" msgid "display text on a buffer" msgstr "バッファ内にテキストを表示" +#, fuzzy msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" "action|-error|-join|-network|-quit] || -stdout|-stderr " diff --git a/po/pl.po b/po/pl.po index 37501fd26..863de27c2 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -2038,9 +2038,10 @@ msgstr "" msgid "display text on a buffer" msgstr "wyświetl tekst w buforze" +#, fuzzy msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" "action|-error|-join|-network|-quit] || -stdout|-stderr " diff --git a/po/pt_BR.po b/po/pt_BR.po index 6b3df7e9d..e7f6b224f 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -1952,7 +1952,7 @@ msgstr "cor do texto para nomes de buffer" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/ru.po b/po/ru.po index 5cf8e40d4..142b9efeb 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -1672,7 +1672,7 @@ msgstr "цвет названия сервера" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/tr.po b/po/tr.po index 965b668e3..77d9c4619 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: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -1482,7 +1482,7 @@ msgstr "" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/po/weechat.pot b/po/weechat.pot index b57299b3d..d3738a5a1 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-02-16 10:12+0100\n" +"POT-Creation-Date: 2014-02-17 11:09+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: weechat-dev \n" @@ -1485,7 +1485,7 @@ msgstr "" msgid "" "[-buffer |] [-core] [-escape] [-date ] [-tags ] [-" -"action|-error|-join|-network|-quit] || -stdout|-stderr " +"action|-error|-join|-network|-quit] [] || -stdout|-stderr []" msgstr "" msgid "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index c3e6ea0d5..fa9061eb8 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -4198,9 +4198,6 @@ COMMAND_CALLBACK(print) /* make C compiler happy */ (void) data; - if (argc < 2) - return WEECHAT_RC_OK; - ptr_buffer = buffer; date = 0; tags = NULL; @@ -4312,12 +4309,9 @@ COMMAND_CALLBACK(print) break; } - if (i >= argc) - return WEECHAT_RC_OK; - if (to_stdout || to_stderr) { - text = string_convert_escaped_chars (argv_eol[i]); + text = string_convert_escaped_chars ((i < argc) ? argv_eol[i] : ""); if (text) { fprintf ((to_stdout) ? stdout : stderr, "%s", text); @@ -4326,7 +4320,7 @@ COMMAND_CALLBACK(print) } else { - text = strdup (argv_eol[i]); + text = strdup ((i < argc) ? argv_eol[i] : ""); if (text) { pos = NULL; @@ -7110,8 +7104,8 @@ command_init () NULL, "print", N_("display text on a buffer"), N_("[-buffer |] [-core] [-escape] [-date ] " - "[-tags ] [-action|-error|-join|-network|-quit] " - " || -stdout|-stderr "), + "[-tags ] [-action|-error|-join|-network|-quit] []" + " || -stdout|-stderr []"), N_("-buffer: the buffer where text is displayed (default: current " "buffer)\n" " -core: alias of \"-buffer core.weechat\"\n"