diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-10 20:52:53 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-10 20:52:53 +0100 |
commit | 7cda6cfd4938b5677fefae50a1def99585d4ec78 (patch) | |
tree | 6a1ad0f447dd72a105a1ead9ec43e1db596459a4 /doc | |
parent | 5f5535b466c281febaab89960c735ad7d4ff5506 (diff) | |
download | weechat-7cda6cfd4938b5677fefae50a1def99585d4ec78.zip |
core: update translations (issue #1888)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/includes/autogen_user_commands.de.adoc | 251 | ||||
-rw-r--r-- | doc/en/includes/autogen_user_commands.en.adoc | 77 | ||||
-rw-r--r-- | doc/fr/includes/autogen_user_commands.fr.adoc | 77 | ||||
-rw-r--r-- | doc/it/includes/autogen_user_commands.it.adoc | 77 | ||||
-rw-r--r-- | doc/ja/includes/autogen_user_commands.ja.adoc | 77 | ||||
-rw-r--r-- | doc/pl/includes/autogen_user_commands.pl.adoc | 231 | ||||
-rw-r--r-- | doc/sr/includes/autogen_user_commands.sr.adoc | 231 |
7 files changed, 521 insertions, 500 deletions
diff --git a/doc/de/includes/autogen_user_commands.de.adoc b/doc/de/includes/autogen_user_commands.de.adoc index 58aa847a4..10ac55acf 100644 --- a/doc/de/includes/autogen_user_commands.de.adoc +++ b/doc/de/includes/autogen_user_commands.de.adoc @@ -1427,133 +1427,136 @@ Beispiele: /eval [-n|-s] [-d] <expression> [-n] [-d [-d]] -c <expression1> <operator> <expression2> - -n: gibt das Ergebnis aus, ohne dass dieses in den Buffer gesendet wird (debug Modus) - -s: teilt Ausdrücke, bevor sie evaluiert werden (mehrere Befehle können durch Semikolon getrennt werden) - -d: eine Debug-Ausgabe nach Auswertung anzeigen (Nutzung von zwei -d: ausführliche Debug-Ausgabe) - -c: Auswertung als Bedingung: nutzt Operatoren und runde Klammern, Rückgabewert als Boolean-Wert ("0" oder "1") -expression: Ausdruck welcher verarbeitet werden soll. Variablen im Format ${variable} werden ersetzt (siehe unten); mehrere Befehle werden durch ein Semikolon voneinander getrennt - operator: ein logischer oder vergleichender Operand: - - logische Operanden: - && boolean "und" - || boolean "oder" - - vergleichende Operanden: - == gleich - != ungleich - <= kleiner oder gleich - < kleiner - >= größer oder gleich - > größer - =~ stimmt mit regulärem POSIX Ausdruck überein - !~ stimmt NICHT mit regulärem POSIX Ausdruck überein - ==* stimmt mit Maske überein (Platzhalter "*" ist erlaubt) - !!* stimmt mit Maske NICHT überein (Platzhalter "*" ist erlaubt) - =* stimmt mit Maske überein, Groß- und Kleinschreibung wird nicht beachtet (Platzhalter "*" ist erlaubt) - !* stimmt mit Maske NICHT überein, Groß- und Kleinschreibung wird nicht beachtet (Platzhalter "*" ist erlaubt) - ==- ist enthalten, Groß- und Kleinschreibung wird beachtet - !!- ist NICHT enthalten, Groß- und Kleinschreibung wird beachtet - =- ist enthalten, Groß- und Kleinschreibung wird nicht beachtet - !- ist NICHT enthalten, Groß- und Kleinschreibung wird nicht beachtet - -Ein Ausdruck gilt als "wahr" sofern das Ergebnis weder NULL, nicht leer und von "0" abweichend ist. -Für einen Vergleich werden Fließkommazahlen genutzt, insofern es sich bei beiden Ausdrücken um gültige Zahlen handelt, folgende Formate werden unterstützt: - - Integer (Beispiele: 5, -7) - - Fließkommazahl (Beispiele: 5.2, -7.5, 2.83e-2) - - hexadezimale Zahl (Beispiele: 0xA3, -0xA3) -Um einen Vergleich zwischen zwei Zeichenketten zu erzwingen, müssen die Ausdrücke in Anführungszeichen gesetzt werden, zum Beispiel: + -n: display result without sending it to buffer (debug mode) + -s: split expression before evaluating it (many commands can be separated by semicolons) + -d: display debug output after evaluation (with two -d: more verbose debug) + -c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1") +expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons + operator: a logical or comparison operator: + - logical operators: + && boolean "and" + || boolean "or" + - comparison operators: + == equal + != not equal + <= less or equal + < less + >= greater or equal + > greater + =~ is matching POSIX extended regex + !~ is NOT matching POSIX extended regex + ==* is matching mask, case sensitive (wildcard "*" is allowed) + !!* is NOT matching mask, case sensitive (wildcard "*" is allowed) + =* is matching mask, case insensitive (wildcard "*" is allowed) + !* is NOT matching mask, case insensitive (wildcard "*" is allowed) + ==- is included, case sensitive + !!- is NOT included, case sensitive + =- is included, case insensitive + !- is NOT included, case insensitive + +An expression is considered as "true" if it is not NULL, not empty, and different from "0". +The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats: + - integer (examples: 5, -7) + - floating point number (examples: 5.2, -7.5, 2.83e-2) + - hexadecimal number (examples: 0xA3, -0xA3) +To force a string comparison, you can add double quotes around each expression, for example: 50 > 100 ==> 0 "50" > "100" ==> 1 -Einige Variablen werden im Ausdruck mittels der Formatierung ${variable} ersetzt. Mögliche Variablen sind, nach Reihenfolge ihrer Priorität: - - die Zeichenfolge selbst ohne Auswertung (Format: "raw:xxx") - - eine benutzerdefinierte Variable (Format: "name") - - eine evaluierte Teilzeichenkette (Format: "eval:xxx") - - eine evaluierte Bedingung (Format: "eval_cond:xxx") - - eine Zeichenkette mit Escapesequenzen (Format: "esc:xxx" oder "\xxx") - - eine Zeichenfolge mit einer Reihe von Zeichen (Format: "chars:xxx" oder "chars:c1-c2" wobei "xxx" von folgenden Typ sein muss: "digit", "xdigit", "lower", "upper", "alpha", "alnum") - - eine Zeichenfolge, die in Kleinbuchstaben umgewandelt wird (Format: "lower:xxx") - - eine Zeichenfolge, die in Großbuchstaben umgewandelt wird (Format: "upper:xxx") - - Zeichen, die in einer Zeichenkette nicht dargestellt werden sollen (Format: "hide:Zeichen,Zeichenkette") - - eine Zeichenkette mit einer maximalen Anzahl an Zeichen (Format: "cut:max,suffix,string" oder "cut:+max,suffix,string") - oder maximale Anzahl an Zeichen die auf dem Bildschirm angezeigt werden sollen (Format: "cutscr:Max,Suffix,Zeichenkette oder "cutscr:+Max,Suffix,Zeichenkette") - - eine Zeichenkette umkehren (Format: "rev:xxx" oder "revscr:xxx") - - eine Zeichenkette wiederholen (Format: "repeat:Anzahl,Zeichenkette") - - Länge einer Zeichenkette (Format: "length:xxx" oder "lengthscr:xxx") - - Aufteilen einer Zeichenkette (Format: "split:Anzahl,Trennzeichen,Flags,xxx") - - Aufteilen von Shell-Argumenten (Format: "split_shell:Anzahl,xxx") - - eine Farbe (Format: "color:xxx", siehe "Anleitung für API Erweiterung", Funktion "color") - - zum modifizieren (Format: "modifier:name,data,string") - - eine Info (Format: "Info:Name,Argumente", Argumente sind optional) - - eine Basis 16/32/64 kodierte / dekodierte Zeichenfolge (Format: "base_encode:base,xxx" oder "base_decode:base,xxx") - - aktuelles Datum/Uhrzeit (Format: "date" oder "date:format") - - eine Umgebungsvariable (Format: "env:XXX") - - ein Dreifachoperand (Format: "if:Bedingung?Wert_falls_wahr:Wert_falls_unwahr") - - Ergebnis eines Ausdrucks mit Klammern und Operatoren + - * / // % ** (Format: "calc:xxx") - - eine zufällige ganze Zahl (Format: "random:min,max") - - eine übersetzte Zeichenkette (Format: "translate:xxx") - - eine Benutzervariable definieren (Format: "define:Name,Wert") - - eine Option (Format: "file.section.option") - - eine lokale Variable eines Buffers - - ein(e) hdata - Name/Variable (der Wert wird automatisch in eine Zeichenkette konvertiert), standardmäßig wird für "window" und "buffer" das aktuelle Fenster/Buffer verwendet. -Das Format für hdata kann wie folgt aufgebaut sein: - hdata.var1.var2...: startet mit hdata (der Pointer muss bekannt sein) und fragt eine Variable nach der anderen ab (weitere hdata können folgen) - hdata[list].var1.var2...: startet hdata mittels einer Liste, zum Beispiel: - ${buffer[gui_buffers].full_name}: der vollständige Name des ersten Buffers, in der verknüpften Liste aller Buffer - ${plugin[weechat_plugins].name}: Name der ersten Erweiterung, in der verknüpften Liste aller Erweiterungen - hdata[pointer].var1.var2...: startet hdata mittels einem Pointer, zum Beispiel: - ${buffer[0x1234abcd].full_name}: vollständiger Name eines Buffers und des dazugehörigen Pointers (kann in triggern benutzt werden) - ${buffer[my_pointer].full_name}: vollständiger Name des Buffers mit dem entsprechenden Pointernamen (kann in Triggern verwendet werden) -Die vorhandenen Namen für hdata und Variablen sind in der "Anleitung für API Erweiterung", Bereich "weechat_hdata_get". beschrieben - -Beispiele (einfache Zeichenketten): - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> geheim - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 - /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 - /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 - /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Erweiterung - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 - -Beispiele (Bedingungen): - /eval -n -c ${window.buffer.number} > 2 ==> 0 - /eval -n -c ${window.win_width} > 100 ==> 1 - /eval -n -c (8 > 12) || (5 > 2) ==> 1 - /eval -n -c (8 > 12) && (5 > 2) ==> 0 - /eval -n -c abcd =~ ^ABC ==> 1 - /eval -n -c abcd =~ (?-i)^ABC ==> 0 - /eval -n -c abcd =~ (?-i)^abc ==> 1 - /eval -n -c abcd !~ abc ==> 0 - /eval -n -c abcd =* a*d ==> 1 - /eval -n -c abcd =- bc ==> 1 +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + - the string itself without evaluation (format: "raw:xxx") + - a user-defined variable (format: "name") + - an evaluated sub-string (format: "eval:xxx") + - an evaluated condition (format: "eval_cond:xxx") + - a string with escaped chars (format: "esc:xxx" or "\xxx") + - a string with a range of chars (format: "chars:xxx" or "chars:c1-c2" where "xxx" is one of: "digit", "xdigit", "lower", "upper", "alpha", "alnum") + - a string converted to lower case (format: "lower:xxx") + - a string converted to upper case (format: "upper:xxx") + - a string with chars to hide (format: "hide:char,string") + - a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string") + or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string") + - a reversed string (format: "rev:xxx" or "revscr:xxx") + - a repeated string (format: "repeat:count,string") + - length of a string (format: "length:xxx" or "lengthscr:xxx") + - split of a string (format: "split:number,separators,flags,xxx") + - split of shell argmuents (format: "split_shell:number,xxx") + - a color (format: "color:xxx", see "Plugin API reference", function "color") + - a modifier (format: "modifier:name,data,string") + - an info (format: "info:name,arguments", arguments are optional) + - a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx") + - current date/time (format: "date" or "date:format") + - an environment variable (format: "env:XXX") + - a ternary operator (format: "if:condition?value_if_true:value_if_false") + - result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx") + - a random integer number (format: "random:min,max") + - a translated string (format: "translate:xxx") + - define a user variable (format: "define:name,value") + - an option (format: "file.section.option") + - a local variable in buffer + - a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. +Format for hdata can be one of following: + hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed) + hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example: + ${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers + ${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins + hdata[pointer].var1.var2...: start with a hdata using a pointer, for example: + ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers) + ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers) + hdata[pointer].var1.method(): when var1 is a hashtable, methods "keys()", "values()", "keys_sorted()", "keys_values()" and "keys_values_sorted()" can be called +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + +Examples (conditions): + /eval -n -c ${window.buffer.number} > 2 ==> 0 + /eval -n -c ${window.win_width} > 100 ==> 1 + /eval -n -c (8 > 12) || (5 > 2) ==> 1 + /eval -n -c (8 > 12) && (5 > 2) ==> 0 + /eval -n -c abcd =~ ^ABC ==> 1 + /eval -n -c abcd =~ (?-i)^ABC ==> 0 + /eval -n -c abcd =~ (?-i)^abc ==> 1 + /eval -n -c abcd !~ abc ==> 0 + /eval -n -c abcd =* a*d ==> 1 + /eval -n -c abcd =- bc ==> 1 ---- [[command_weechat_filter]] diff --git a/doc/en/includes/autogen_user_commands.en.adoc b/doc/en/includes/autogen_user_commands.en.adoc index fd28ec0fd..c767b6cdf 100644 --- a/doc/en/includes/autogen_user_commands.en.adoc +++ b/doc/en/includes/autogen_user_commands.en.adoc @@ -1502,46 +1502,49 @@ Format for hdata can be one of following: hdata[pointer].var1.var2...: start with a hdata using a pointer, for example: ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers) ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers) + hdata[pointer].var1.method(): when var1 is a hashtable, methods "keys()", "values()", "keys_sorted()", "keys_values()" and "keys_values_sorted()" can be called For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". Examples (simple strings): - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> secret - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 - /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 - /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 - /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Extension - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 Examples (conditions): /eval -n -c ${window.buffer.number} > 2 ==> 0 diff --git a/doc/fr/includes/autogen_user_commands.fr.adoc b/doc/fr/includes/autogen_user_commands.fr.adoc index fb0bdce88..c6bb7fffd 100644 --- a/doc/fr/includes/autogen_user_commands.fr.adoc +++ b/doc/fr/includes/autogen_user_commands.fr.adoc @@ -1502,46 +1502,49 @@ Le format du hdata peut être le suivant : hdata[pointeur].var1.var2... : démarrer avec un hdata en utilisant un pointeur, par exemple : ${buffer[0x1234abcd].full_name} : nom complet du tampon avec ce pointeur (peut être utilisé dans les triggers) ${buffer[my_pointer].full_name} : nom complet du tampon avec ce nom de pointeur (peut être utilisé dans les triggers) + hdata[pointeur].var1.méthode() : lorsque var1 est une table de hachage, les méthodes "keys()", "values()", "keys_sorted()", "keys_values()" et "keys_values_sorted()" peuvent être appelées Pour le nom du hdata et des variables, voir la "Référence API extension", fonction "weechat_hdata_get". Exemples (chaînes simples) : - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> secret - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 - /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 - /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 - /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Extension - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 Exemples (conditions) : /eval -n -c ${window.buffer.number} > 2 ==> 0 diff --git a/doc/it/includes/autogen_user_commands.it.adoc b/doc/it/includes/autogen_user_commands.it.adoc index 307193e5b..a87264f00 100644 --- a/doc/it/includes/autogen_user_commands.it.adoc +++ b/doc/it/includes/autogen_user_commands.it.adoc @@ -1502,46 +1502,49 @@ Format for hdata can be one of following: hdata[pointer].var1.var2...: start with a hdata using a pointer, for example: ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers) ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers) + hdata[pointer].var1.method(): when var1 is a hashtable, methods "keys()", "values()", "keys_sorted()", "keys_values()" and "keys_values_sorted()" can be called For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". Examples (simple strings): - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> secret - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 - /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 - /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 - /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Extension - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 Examples (conditions): /eval -n -c ${window.buffer.number} > 2 ==> 0 diff --git a/doc/ja/includes/autogen_user_commands.ja.adoc b/doc/ja/includes/autogen_user_commands.ja.adoc index 6766bb810..f8e3924bc 100644 --- a/doc/ja/includes/autogen_user_commands.ja.adoc +++ b/doc/ja/includes/autogen_user_commands.ja.adoc @@ -1502,46 +1502,49 @@ Format for hdata can be one of following: hdata[pointer].var1.var2...: start with a hdata using a pointer, for example: ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers) ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers) + hdata[pointer].var1.method(): when var1 is a hashtable, methods "keys()", "values()", "keys_sorted()", "keys_values()" and "keys_values_sorted()" can be called For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". Examples (simple strings): - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> secret - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 - /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 - /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 - /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Extension - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 Examples (conditions): /eval -n -c ${window.buffer.number} > 2 ==> 0 diff --git a/doc/pl/includes/autogen_user_commands.pl.adoc b/doc/pl/includes/autogen_user_commands.pl.adoc index 0211f6ef0..2719de1c0 100644 --- a/doc/pl/includes/autogen_user_commands.pl.adoc +++ b/doc/pl/includes/autogen_user_commands.pl.adoc @@ -1426,123 +1426,126 @@ Przykłady: /eval [-n|-s] [-d] <wyrażenie> [-n] [-d [-d]] -c <wyrażenie1> <operator> <wyrażenie2> - -n: wyświetla wynik bez wysyłania go do buforu (tryb debugowania) - -s: podziel wyrażenie przed przetworzeniem go (wiele komend może być oddzielonych średnikami) - -d: wyświetl wyjście debugowe po ewaluacji (drugie -d: wyświetli więcej informacji) - -c: przetwarza jako warunek: użyj operatorów i nawiasów, zwraca wartość logiczną ("0" lub "1") -wyrażenie: wyrażenie do przetworzenia, zmienne o formacie ${zmienna} są zastępowane (zobacz niżej); wiele komend można oddzielić średnikami - operator: operator logiczny lub porównania: - - operatory logiczne: - && logiczne „i” - || logiczne „lub” - - operatory porównania: - == równy - != różny - <= mniejszy lub równy - < mniejszy - >= większy lub równy - > większy - =~ pasuje do rozszerzonego wyrażenia regularnego POSIX - !~ NIE pasuje do rozszerzonego wyrażenia regularnego POSIX - ==* pasuje do maski, rozróżnia wielkość znaków (dzika karta „*” dozwolona) - !!* NIE pasuje do maski, rozróżnia wielkość znaków (dzika karta „*” dozwolona) - =* pasuje do maski, nie rozróżnia wielkość znaków (dzika karta „*” dozwolona) - !* NIE pasuje do maski, nie rozróżnia wielkość znaków (dzika karta „*” dozwolona) - ==- jest zawarte, rozróżnia wielkość znaków - !!- NIE jest zawarte,rozróżnia wielkość znaków - =- jest zawarte, nie rozróżnia wielkość znaków - !- NIE jest zawarte, nie rozróżnia wielkość znaków - -Wyrażenie jest uznawane za „prawdziwe” jeśli nie jest NULL, nie jest puste, oraz różni się od „0”. -Porównania dokonuje się z użyciem liczb całkowitych jeśli oba wyrażenia są liczbami całkowitymi, w jednym z następujących formatów: - - liczby całkowite (przykłady: 5, -7) - - liczby zmiennoprzecinkowe (przykłady: 5.2, -7.5, 2.83e-2) - - liczby szesnastkowe (przykłady: 0xA3, -0xA3) -W celu wymuszenia porównywania ciągów, należy umieścić każde wyrażenie w cudzysłowie, na przykład: + -n: display result without sending it to buffer (debug mode) + -s: split expression before evaluating it (many commands can be separated by semicolons) + -d: display debug output after evaluation (with two -d: more verbose debug) + -c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1") +expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons + operator: a logical or comparison operator: + - logical operators: + && boolean "and" + || boolean "or" + - comparison operators: + == equal + != not equal + <= less or equal + < less + >= greater or equal + > greater + =~ is matching POSIX extended regex + !~ is NOT matching POSIX extended regex + ==* is matching mask, case sensitive (wildcard "*" is allowed) + !!* is NOT matching mask, case sensitive (wildcard "*" is allowed) + =* is matching mask, case insensitive (wildcard "*" is allowed) + !* is NOT matching mask, case insensitive (wildcard "*" is allowed) + ==- is included, case sensitive + !!- is NOT included, case sensitive + =- is included, case insensitive + !- is NOT included, case insensitive + +An expression is considered as "true" if it is not NULL, not empty, and different from "0". +The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats: + - integer (examples: 5, -7) + - floating point number (examples: 5.2, -7.5, 2.83e-2) + - hexadecimal number (examples: 0xA3, -0xA3) +To force a string comparison, you can add double quotes around each expression, for example: 50 > 100 ==> 0 "50" > "100" ==> 1 -Niektóre zmienne w wyrażeniach są zamieniane, poprzez zastosowanie formatu ${zmienna}, według priorytetu zmienną może być: - - nieprzetworzony ciąg (format: "raw:xxx") - - zmienna zdefiniowana przez użytkownika (format: "name") - - przetworzony ciąg (format: "eval:xxx") - - przetworzony warunek (format: "eval_cond:xxx") - - ciąg z wyescapowanymi znakami (format: "esc:xxx" lub "\xxx") - - ciąg z zakresem znaków (format: "chars:xxx" lub "chars:c1-c2" gdzie "xxx" to jedno z: "digit", "xdigit", "lower", "upper", "alpha", "alnum") - - ciąg skonwertowany na małe litery (format: "lower:xxx") - - ciąg skonwertowany na wielkie litery (format: "upper:xxx") - - ciąg ze znakami do ukrycia (format: "hide:char,string") - - ciąg o maksymalnej długości (format: "cut:max,suffix,string" lub "cut:+max,suffix,string") - lub maksymalna ilość znaków wyświetlanych na ekranie (format: "cutscr:max,suffix,string" lub "cutscr:+max,suffix,string") - - odwrócony ciąg (format: "rev:xxx" lub "revscr:xxx") - - powtórzony ciąg (format: "repeat:ilość,ciąg") - - długość ciągu (format: "length:xxx" or "lengthscr:xxx") - - podział ciągu (format: "split:number,separators,flags,xxx") - - podział argumentów powłoki (format: "split_shell:number,xxx") - - kolor (format "color:xxx", zobacz „Opis API wtyczek”, funkcja "color") - - modyfikator (format: "modifier:name,data,string") - - informacja (format: "info:nazwa,argumenty", argumenty są opcjonalne) - - ciąg zakodowany/zdekodowany z base 16/32/64 (format: "base_encode:base,xxx" lub "base_decode:base,xxx") - - obecna data/czas (format: "date" lub "date:format") - - zmienna środowiskowa (format: "env:XXX") - - wyrażenie warunkowe (format: "if:warunek?wartość_jeśli_prawda:wartość_jeśli_fałsz") - - wynik wyrażenia z nawiasami i operatorami + - * / // % ** (format: "calc:xxx") - - losowa liczba całkowita (format: "random:min,max") - - przetłumaczony ciąg (format: "translate:xxx") - - definiowanie zmiennej użytkownika (format: "define:nazwa,wartość") - - opcja (format: plik.sekcja.opcja) - - zmienna lokalna w buforze - - nazwa hdatay/zmiennej (wartość jest automatycznie konwertowana na ciąg znaków), domyślnie „window” i „buffer” wskazują na aktualne okno/bufor. -Format dla hdata może być jednym z poniższych: - hdata.zmienna1.zmienna2...: inicjuje hdata (wskaźnik musi być znany), następnie wypytuje zmienne jedna po drugiej (inne hdata mogą być następne) - hdata[list].zmienna1.zmienna2...: inicjuje hdata z wykorzystaniem listy, na przykład: - ${buffer[gui_buffers].full_name}: pełna nazwa buforu w połączonej liście buforów - ${plugin[weechat_plugins].name}: nazwa pierwszej wtyczki w połączonej liście wtyczek - hdata[wskaźnik].zmienna1.zmienna2...: zacznij z hdata używając wskaźnika, na przykład: - ${buffer[0x1234abcd].full_name}: pełna nazwa buforu z tym wskaźnikiem (może zostać użyte w triggerach) - ${buffer[my_pointer].full_name}: pełna nazwa buforu z jego wskaźnikiem (może zostać użyte w triggerach) -Nazwy hdata i zmiennych, można znaleźć w „Opisie API wtyczek”, funkcja "weechat_hdata_get". - -Przykłady (proste ciągi): - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> secret - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 - /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 - /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 - /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Wtyczka - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 - -Przykłady (warunki): +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + - the string itself without evaluation (format: "raw:xxx") + - a user-defined variable (format: "name") + - an evaluated sub-string (format: "eval:xxx") + - an evaluated condition (format: "eval_cond:xxx") + - a string with escaped chars (format: "esc:xxx" or "\xxx") + - a string with a range of chars (format: "chars:xxx" or "chars:c1-c2" where "xxx" is one of: "digit", "xdigit", "lower", "upper", "alpha", "alnum") + - a string converted to lower case (format: "lower:xxx") + - a string converted to upper case (format: "upper:xxx") + - a string with chars to hide (format: "hide:char,string") + - a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string") + or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string") + - a reversed string (format: "rev:xxx" or "revscr:xxx") + - a repeated string (format: "repeat:count,string") + - length of a string (format: "length:xxx" or "lengthscr:xxx") + - split of a string (format: "split:number,separators,flags,xxx") + - split of shell argmuents (format: "split_shell:number,xxx") + - a color (format: "color:xxx", see "Plugin API reference", function "color") + - a modifier (format: "modifier:name,data,string") + - an info (format: "info:name,arguments", arguments are optional) + - a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx") + - current date/time (format: "date" or "date:format") + - an environment variable (format: "env:XXX") + - a ternary operator (format: "if:condition?value_if_true:value_if_false") + - result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx") + - a random integer number (format: "random:min,max") + - a translated string (format: "translate:xxx") + - define a user variable (format: "define:name,value") + - an option (format: "file.section.option") + - a local variable in buffer + - a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. +Format for hdata can be one of following: + hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed) + hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example: + ${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers + ${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins + hdata[pointer].var1.var2...: start with a hdata using a pointer, for example: + ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers) + ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers) + hdata[pointer].var1.method(): when var1 is a hashtable, methods "keys()", "values()", "keys_sorted()", "keys_values()" and "keys_values_sorted()" can be called +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + +Examples (conditions): /eval -n -c ${window.buffer.number} > 2 ==> 0 /eval -n -c ${window.win_width} > 100 ==> 1 /eval -n -c (8 > 12) || (5 > 2) ==> 1 diff --git a/doc/sr/includes/autogen_user_commands.sr.adoc b/doc/sr/includes/autogen_user_commands.sr.adoc index 89c6cfceb..fe1f764e0 100644 --- a/doc/sr/includes/autogen_user_commands.sr.adoc +++ b/doc/sr/includes/autogen_user_commands.sr.adoc @@ -1427,123 +1427,126 @@ infolists: исписује инфо о инфолистама /eval [-n|-s] [-d] <израз> [-n] [-d [-d]] -c <израз1> <оператор> <израз2> - -n: приказује резултат и не шаље га у бафер (дибаг режим) - -s: дели израз пре израчунавања (многе команде могу да се раздвоје са тачка зарезима) - -d: приказује дибаг излаз након израчунавања (са два -d: детаљнији дибаг) - -c: израчунава као услов: користе се оператори и заграде, враћа логичку вредност („0” или „1”) - израз: израз који се израчунава, променљиве у формату ${променљива} се замењују (погледајте испод); више команди може да се раздвоји са тачка зарезима - оператор: логички или оператор поређења: - - логички оператори: - && логичко „и” - || логичко „или” - - оператори поређења: - == једнако - != није једнако - <= мање или једнако - < мање - >= веће или једнако - > веће - =~ подудара се са POSIX проширеним регуларним изразом - !~ НЕ подудара се са POSIX проширеним регуларним изразом - ==* је маска подударања, разликује величину слова (дозвољен је џокер „*”) - !!* НИЈЕ маска подударања, разликује величину слова (дозвољен је џокер „*”) - =* је маска подударања, не разликује величину слова (дозвољен је џокер „*”) - !* НИЈЕ маска подударања, не разликује величину слова (дозвољен је џокер „*”) - ==- је укључено, разликује величину слова - !!- НИЈЕ укључено, разликује величину слова - =- је укључено, не разликује величину слова - !- НИЈЕ укључено, не разликује величину слова - -Сматра се да је израз „true” ако није NULL, није празан и различит је од „0”. -Поређење се врши употребом бројева у покретном зарезу ако су два израза важећи бројеви, у једном од следећих формата: - - целобројни (примери: 5, -7) - - број у покретном зарезу (примери: 5.2, -7.5, 2.83e-2) - - хексадецимални број (примери: 0xA3, -0xA3) -Ако желите да форсирате поређење стрингова, можете да додате знаке навода око сваког израза, на пример: + -n: display result without sending it to buffer (debug mode) + -s: split expression before evaluating it (many commands can be separated by semicolons) + -d: display debug output after evaluation (with two -d: more verbose debug) + -c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1") +expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons + operator: a logical or comparison operator: + - logical operators: + && boolean "and" + || boolean "or" + - comparison operators: + == equal + != not equal + <= less or equal + < less + >= greater or equal + > greater + =~ is matching POSIX extended regex + !~ is NOT matching POSIX extended regex + ==* is matching mask, case sensitive (wildcard "*" is allowed) + !!* is NOT matching mask, case sensitive (wildcard "*" is allowed) + =* is matching mask, case insensitive (wildcard "*" is allowed) + !* is NOT matching mask, case insensitive (wildcard "*" is allowed) + ==- is included, case sensitive + !!- is NOT included, case sensitive + =- is included, case insensitive + !- is NOT included, case insensitive + +An expression is considered as "true" if it is not NULL, not empty, and different from "0". +The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats: + - integer (examples: 5, -7) + - floating point number (examples: 5.2, -7.5, 2.83e-2) + - hexadecimal number (examples: 0xA3, -0xA3) +To force a string comparison, you can add double quotes around each expression, for example: 50 > 100 ==> 0 "50" > "100" ==> 1 -У изразима се замењују неке променљиве, користећи формат ${променљива}, променљива може да буде, према редоследу приоритета: - - сам стринг без израчунавања (формат: „raw:xxx”) - - кориснички дефинисана променљива (формат: „име”) - - израчунати под-стринг (формат: „eval:xxx”) - - израчунати услов (формат: „eval_cond:xxx”) - - стринг са означеним карактерима (формат: „esc:xxx” или „\xxx”) - - стринг са опсегом карактера (формат: „chars:xxx” or „chars:c1-c2” где је „xxx” једно од: „digit”, „xdigit”, „lower”, „upper”, „alpha”, „alnum”) - - стринг конвертован у мала слова (формат: „lower:xxx”) - - стринг конвертован у велика слова (формат: „upper:xxx”) - - стринг са карактерима за сакривање (формат: „hide:кар,стринг”) - - стринг са највише карактера (формат: „cut:макс,суфикс,стринг” или „cut:+макс,суфикс,стринг") - или макс број карактера који се приказује на екрану (формат: „cutscr:макс,суфикс,стринг” или „cutscr:+макс,суфикс,стринг”) - - обрнути стринг (формат: „rev:xxx” или „revscr:xxx”) - - поновљени стринг (формат: „repeat:број,стринг”) - - дужина стринга (формат: „length:xxx” или „lengthscr:xxx”) - - подела стринга (формат: „split:број,сепаратори,заставице,xxx”) - - подела аргумената љуске (формат: „split_shell:број,xxx”) - - боја (формат: „color:xxx”, погледајте „Референтни приручник API додатака”, функција „color”) - - модификатор (формат: „modifier:име,подаци,стринг”) - - инфо (формат: „info:име,аргументи”, аргументи нису обавезни) - - base 16/32/64 шифриран/дешифрован стринг (формат: „base_encode:основа, xxx” или „base_decode:основа,xxx”) - - текући датум/време (формат: „date” или „date:формат”) - - променљива окружења (формат: „env:XXX”) - - тернарни оператор (формат: „if:услов?вредност_ако_је_тачно:вредност_ако_је_нетачно”) - - резултат израза са заградама и операторима + - * / // % ** (формат: „calc:xxx”) - - случајни целобројни број (формат: „random:мин,макс”) - - преведени стринг (формат: „translate:xxx”) - - дефиниција корисничке промонљиве (формат: „define:име,вредност”) - - опција (формат: „фајл.секција.опција”) - - локална променљива у баферу - - hdata име/променљива (вредност се аутоматски конвертује у стринг), „window” и „buffer” подразумевано показују на текући прозор/бафер. -Формат за hdata може да буде једно од следећег: - hdata.пром1.пром2...: почиње са hdata (показивач мора да буде познат), и пита променљиве једну за другом (могу да следе и остала hdata) - hdata[листа].пром1.пром2...: почиње са hdata користећи листу/показивач/име показивача, на пример: - ${buffer[gui_buffers].full_name}: пуно име првог бафера у увезаној листи бафера - ${plugin[weechat_plugins].name}: име првог бафера у увезаној листи додатака - hdata[показивач].пром1.пром2...: почиње са hdata користећи показивач, на пример: - ${buffer[0x1234abcd].full_name}: пуно име бафера са овим показивачем (може да се користи у окидачима) - ${buffer[my_pointer].full_name}: пуно име бафера са овим именом показивача (може да се користи у окидачима) -У вези имена hdata и променљивих, молим вас да погледате „Референтни приручник API додатака”, функцију „weechat_hdata_get”. - -Примери (једноставни стрингови): - /eval -n ${raw:${info:version}} ==> ${info:version} - /eval -n ${eval_cond:${window.win_width}>100} ==> 1 - /eval -n ${info:version} ==> 0.4.3 - /eval -n ${env:HOME} ==> /home/user - /eval -n ${weechat.look.scroll_amount} ==> 3 - /eval -n ${sec.data.password} ==> secret - /eval -n ${window} ==> 0x2549aa0 - /eval -n ${window.buffer} ==> 0x2549320 - /eval -n ${window.buffer.full_name} ==> core.weechat - /eval -n ${window.buffer.number} ==> 1 - /eval -n ${\t} ==> <tab> - /eval -n ${chars:digit} ==> 0123456789 - /eval -n ${chars:J-T} ==> JKLMNOPQRST - /eval -n ${lower:TEST} ==> test - /eval -n ${upper:test} ==> TEST - /eval -n ${hide:-,${relay.network.password}} ==> -------- - /eval -n ${cut:3,+,test} ==> tes+ - /eval -n ${cut:+3,+,test} ==> te+ - /eval -n ${date:%H:%M:%S} ==> 07:46:40 - /eval -n ${if:${info:term_width}>80?big:small} ==> big - /eval -n ${rev:Hello} ==> olleH - /eval -n ${repeat:5,-} ==> ----- - /eval -n ${length:test} ==> 4 - /eval -n ${split:1,,,abc,def,ghi} ==> abc - /eval -n ${split:-1,,,abc,def,ghi} ==> ghi - /eval -n ${split:count,,,abc,def,ghi} ==> 3 - /eval -n ${split:random,,,abc,def,ghi} ==> def - /eval -n ${split_shell:1,„arg 1” arg2} ==> arg 1 - /eval -n ${split_shell:-1,„arg 1” arg2} ==> arg2 - /eval -n ${split_shell:count,„arg 1” arg2} ==> 2 - /eval -n ${split_shell:random,„arg 1” arg2} ==> arg2 - /eval -n ${calc:(5+2)*3} ==> 21 - /eval -n ${random:0,10} ==> 3 - /eval -n ${base_encode:64,test} ==> dGVzdA== - /eval -n ${base_decode:64,dGVzdA==} ==> test - /eval -n ${translate:Plugin} ==> Extension - /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 - -Примери (услови): +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + - the string itself without evaluation (format: "raw:xxx") + - a user-defined variable (format: "name") + - an evaluated sub-string (format: "eval:xxx") + - an evaluated condition (format: "eval_cond:xxx") + - a string with escaped chars (format: "esc:xxx" or "\xxx") + - a string with a range of chars (format: "chars:xxx" or "chars:c1-c2" where "xxx" is one of: "digit", "xdigit", "lower", "upper", "alpha", "alnum") + - a string converted to lower case (format: "lower:xxx") + - a string converted to upper case (format: "upper:xxx") + - a string with chars to hide (format: "hide:char,string") + - a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string") + or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string") + - a reversed string (format: "rev:xxx" or "revscr:xxx") + - a repeated string (format: "repeat:count,string") + - length of a string (format: "length:xxx" or "lengthscr:xxx") + - split of a string (format: "split:number,separators,flags,xxx") + - split of shell argmuents (format: "split_shell:number,xxx") + - a color (format: "color:xxx", see "Plugin API reference", function "color") + - a modifier (format: "modifier:name,data,string") + - an info (format: "info:name,arguments", arguments are optional) + - a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx") + - current date/time (format: "date" or "date:format") + - an environment variable (format: "env:XXX") + - a ternary operator (format: "if:condition?value_if_true:value_if_false") + - result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx") + - a random integer number (format: "random:min,max") + - a translated string (format: "translate:xxx") + - define a user variable (format: "define:name,value") + - an option (format: "file.section.option") + - a local variable in buffer + - a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. +Format for hdata can be one of following: + hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed) + hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example: + ${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers + ${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins + hdata[pointer].var1.var2...: start with a hdata using a pointer, for example: + ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers) + ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers) + hdata[pointer].var1.method(): when var1 is a hashtable, methods "keys()", "values()", "keys_sorted()", "keys_values()" and "keys_values_sorted()" can be called +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): + /eval -n ${raw:${info:version}} ==> ${info:version} + /eval -n ${eval_cond:${window.win_width}>100} ==> 1 + /eval -n ${info:version} ==> 0.4.3 + /eval -n ${env:HOME} ==> /home/user + /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.password} ==> secret + /eval -n ${window} ==> 0x2549aa0 + /eval -n ${window.buffer} ==> 0x2549320 + /eval -n ${window.buffer.full_name} ==> core.weechat + /eval -n ${window.buffer.number} ==> 1 + /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat + /eval -n ${buffer.local_variables.plugin} ==> core + /eval -n ${\t} ==> <tab> + /eval -n ${chars:digit} ==> 0123456789 + /eval -n ${chars:J-T} ==> JKLMNOPQRST + /eval -n ${lower:TEST} ==> test + /eval -n ${upper:test} ==> TEST + /eval -n ${hide:-,${relay.network.password}} ==> -------- + /eval -n ${cut:3,+,test} ==> tes+ + /eval -n ${cut:+3,+,test} ==> te+ + /eval -n ${date:%H:%M:%S} ==> 07:46:40 + /eval -n ${if:${info:term_width}>80?big:small} ==> big + /eval -n ${rev:Hello} ==> olleH + /eval -n ${repeat:5,-} ==> ----- + /eval -n ${length:test} ==> 4 + /eval -n ${split:1,,,abc,def,ghi} ==> abc + /eval -n ${split:-1,,,abc,def,ghi} ==> ghi + /eval -n ${split:count,,,abc,def,ghi} ==> 3 + /eval -n ${split:random,,,abc,def,ghi} ==> def + /eval -n ${split_shell:1,"arg 1" arg2} ==> arg 1 + /eval -n ${split_shell:-1,"arg 1" arg2} ==> arg2 + /eval -n ${split_shell:count,"arg 1" arg2} ==> 2 + /eval -n ${split_shell:random,"arg 1" arg2} ==> arg2 + /eval -n ${calc:(5+2)*3} ==> 21 + /eval -n ${random:0,10} ==> 3 + /eval -n ${base_encode:64,test} ==> dGVzdA== + /eval -n ${base_decode:64,dGVzdA==} ==> test + /eval -n ${translate:Plugin} ==> Extension + /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8 + +Examples (conditions): /eval -n -c ${window.buffer.number} > 2 ==> 0 /eval -n -c ${window.win_width} > 100 ==> 1 /eval -n -c (8 > 12) || (5 > 2) ==> 1 |