mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 18:23:13 +02:00
core: update translations
This commit is contained in:
@@ -1373,130 +1373,133 @@ infolists: zeigt Information über die Infolists an
|
||||
/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
|
||||
-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
|
||||
|
||||
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:
|
||||
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:
|
||||
1. die Zeichenfolge selbst ohne Auswertung (Format: "raw:xxx")
|
||||
2. eine benutzerdefinierte Variable (Format: "name")
|
||||
3. eine evaluierte Teilzeichenkette (Format: "eval:xxx")
|
||||
4. eine evaluierte Bedingung (Format: "eval_cond:xxx")
|
||||
5. eine Zeichenkette mit Escapesequenzen (Format: "esc:xxx" oder "\xxx")
|
||||
6. eine Zeichenfolge, die in Kleinbuchstaben umgewandelt wird (Format: "lower:xxx")
|
||||
7. eine Zeichenfolge, die in Großbuchstaben umgewandelt wird (Format: "upper:xxx")
|
||||
8. Zeichen, die in einer Zeichenkette nicht dargestellt werden sollen (Format: "hide:Zeichen,Zeichenkette")
|
||||
9. 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")
|
||||
10. eine Zeichenkette umkehren (Format: "rev:xxx" oder "revscr:xxx")
|
||||
11. eine Zeichenkette wiederholen (Format: "repeat:Anzahl,Zeichenkette")
|
||||
12. Länge einer Zeichenkette (Format: "length:xxx" oder "lengthscr:xxx")
|
||||
13. Aufteilen einer Zeichenkette (Format: "split:Anzahl,Trennzeichen,Flags,xxx")
|
||||
14. Aufteilen von Shell-Argumenten (Format: "split_shell:Anzahl,xxx")
|
||||
15. eine Farbe (Format: "color:xxx", siehe "Anleitung für API Erweiterung", Funktion "color")
|
||||
16. zum modifizieren (Format: "modifier:name,data,string")
|
||||
17. eine Info (Format: "Info:Name,Argumente", Argumente sind optional)
|
||||
18. eine Basis 16/32/64 kodierte / dekodierte Zeichenfolge (Format: "base_encode:base,xxx" oder "base_decode:base,xxx")
|
||||
19. aktuelles Datum/Uhrzeit (Format: "date" oder "date:format")
|
||||
20. eine Umgebungsvariable (Format: "env:XXX")
|
||||
21. ein Dreifachoperand (Format: "if:Bedingung?Wert_falls_wahr:Wert_falls_unwahr")
|
||||
22. Ergebnis eines Ausdrucks mit Klammern und Operatoren + - * / // % ** (Format: "calc:xxx")
|
||||
23. eine zufällige ganze Zahl (Format: "random:min,max")
|
||||
24. eine übersetzte Zeichenkette (Format: "translate:xxx")
|
||||
25. eine Benutzervariable definieren (Format: "define:Name,Wert")
|
||||
26. eine Option (Format: "file.section.option")
|
||||
27. eine lokale Variable eines Buffers
|
||||
28. 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
|
||||
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)
|
||||
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
|
||||
|
||||
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>
|
||||
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} ==> Erweiterung
|
||||
/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
|
||||
|
||||
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
|
||||
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]]
|
||||
|
||||
@@ -1410,35 +1410,36 @@ To force a string comparison, you can add double quotes around each expression,
|
||||
"50" > "100" ==> 1
|
||||
|
||||
Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
|
||||
1. the string itself without evaluation (format: "raw:xxx")
|
||||
2. a user-defined variable (format: "name")
|
||||
3. an evaluated sub-string (format: "eval:xxx")
|
||||
4. an evaluated condition (format: "eval_cond:xxx")
|
||||
5. a string with escaped chars (format: "esc:xxx" or "\xxx")
|
||||
6. a string converted to lower case (format: "lower:xxx")
|
||||
7. a string converted to upper case (format: "upper:xxx")
|
||||
8. a string with chars to hide (format: "hide:char,string")
|
||||
9. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
|
||||
- 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")
|
||||
10. a reversed string (format: "rev:xxx" or "revscr:xxx")
|
||||
11. a repeated string (format: "repeat:count,string")
|
||||
12. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
13. split of a string (format: "split:number,separators,flags,xxx")
|
||||
14. split of shell argmuents (format: "split_shell:number,xxx")
|
||||
15. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
16. a modifier (format: "modifier:name,data,string")
|
||||
17. an info (format: "info:name,arguments", arguments are optional)
|
||||
18. a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx")
|
||||
19. current date/time (format: "date" or "date:format")
|
||||
20. an environment variable (format: "env:XXX")
|
||||
21. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
22. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
23. a random integer number (format: "random:min,max")
|
||||
24. a translated string (format: "translate:xxx")
|
||||
25. define a user variable (format: "define:name,value")
|
||||
26. an option (format: "file.section.option")
|
||||
27. a local variable in buffer
|
||||
28. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
- 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:
|
||||
@@ -1461,6 +1462,8 @@ Examples (simple strings):
|
||||
/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}} ==> --------
|
||||
|
||||
@@ -1410,35 +1410,36 @@ Pour forcer une comparaison de chaînes, vous pouvez ajouter des guillemets auto
|
||||
"50" > "100" ==> 1
|
||||
|
||||
Des variables sont remplacées dans l'expression, en utilisant le format ${variable}, la variable pouvant être, par ordre de priorité :
|
||||
1. la chaîne elle-même sans évaluation (format : "raw:xxx")
|
||||
2. une variable définie par l'utilisateur (format : "nom")
|
||||
3. une sous-chaîne évaluée (format : "eval:xxx")
|
||||
4. une condition évaluée (format : "eval_cond:xxx")
|
||||
5. une chaîne avec les caractères échappés (format : "esc:xxx" ou "\xxx")
|
||||
6. une chaîne convertie en minuscules (format : "lower:xxx")
|
||||
7. une chaîne convertie en majuscules (format : "upper:xxx")
|
||||
8. une chaîne avec des caractères à cacher (format : "hide:caractère,chaîne")
|
||||
9. une chaîne avec un maximum de caractères (format : "cut:max,suffixe,chaîne" ou "cut:+max,suffixe,chaîne")
|
||||
ou un maximum de caractères affichés à l'écran (format : "cutscr:max,suffixe,chaîne" ou "cutscr:+max,suffixe,chaîne")
|
||||
10. une chaîne inversée (format : "rev:xxx" ou "revscr:xxx")
|
||||
11. une chaîne répétée (format : "repeat:nombre,chaîne")
|
||||
12. longueur d'une chaîne (format : "length:xxx" ou "lengthscr:xxx")
|
||||
13. découpage d'une chaîne (format : "split:nombre,séparateurs,flags,xxx")
|
||||
14. découpage de paramètres shell (format : "split_shell:nombre,xxx")
|
||||
15. une couleur (format : "color:xxx", voir la "Référence API extension", fonction "color")
|
||||
16. un modificateur (format : "modifier:nom,données,chaîne")
|
||||
17. une info (format : "info:nom,paramètres", les paramètres sont optionnels)
|
||||
18. une chaîne encodée/decodée en base 16, 32 ou 64 (format : "base_encode:base,xxx" ou "base_decode:base,xxx")
|
||||
19. la date/heure courante (format : "date" ou "date:format")
|
||||
20. une variable d'environnement (format : "env:XXX")
|
||||
21. un opérateur ternaire (format : "if:condition?valeur_si_vrai:valeur_si_faux")
|
||||
22. le résultat d'une expression avec parenthèses et les opérateurs + - * / // % ** (format : "calc:xxx")
|
||||
23. un nombre entier aléatoire (format : "random:min,max")
|
||||
24. une chaîne traduite (format : "translate:xxx")
|
||||
25. déclaration d'une variable utilisateur (format : "define:nom,valeur")
|
||||
26. une option (format : "fichier.section.option")
|
||||
27. une variable locale du tampon
|
||||
28. un hdata/variable (la valeur est automatiquement convertie en chaîne), par défaut "window" et "buffer" pointent vers la fenêtre et le tampon courants.
|
||||
- la chaîne elle-même sans évaluation (format : "raw:xxx")
|
||||
- une variable définie par l'utilisateur (format : "nom")
|
||||
- une sous-chaîne évaluée (format : "eval:xxx")
|
||||
- une condition évaluée (format : "eval_cond:xxx")
|
||||
- une chaîne avec les caractères échappés (format : "esc:xxx" ou "\xxx")
|
||||
- une chaîne avec un intervalle de caractères (format : "chars:xxx" ou "chars:c1-c2")
|
||||
- une chaîne convertie en minuscules (format : "lower:xxx")
|
||||
- une chaîne convertie en majuscules (format : "upper:xxx")
|
||||
- une chaîne avec des caractères à cacher (format : "hide:caractère,chaîne")
|
||||
- une chaîne avec un maximum de caractères (format : "cut:max,suffixe,chaîne" ou "cut:+max,suffixe,chaîne")
|
||||
ou un maximum de caractères affichés à l'écran (format : "cutscr:max,suffixe,chaîne" ou "cutscr:+max,suffixe,chaîne")
|
||||
- une chaîne inversée (format : "rev:xxx" ou "revscr:xxx")
|
||||
- une chaîne répétée (format : "repeat:nombre,chaîne")
|
||||
- longueur d'une chaîne (format : "length:xxx" ou "lengthscr:xxx")
|
||||
- découpage d'une chaîne (format : "split:nombre,séparateurs,flags,xxx")
|
||||
- découpage de paramètres shell (format : "split_shell:nombre,xxx")
|
||||
- une couleur (format : "color:xxx", voir la "Référence API extension", fonction "color")
|
||||
- un modificateur (format : "modifier:nom,données,chaîne")
|
||||
- une info (format : "info:nom,paramètres", les paramètres sont optionnels)
|
||||
- une chaîne encodée/decodée en base 16, 32 ou 64 (format : "base_encode:base,xxx" ou "base_decode:base,xxx")
|
||||
- la date/heure courante (format : "date" ou "date:format")
|
||||
- une variable d'environnement (format : "env:XXX")
|
||||
- un opérateur ternaire (format : "if:condition?valeur_si_vrai:valeur_si_faux")
|
||||
- le résultat d'une expression avec parenthèses et les opérateurs + - * / // % ** (format : "calc:xxx")
|
||||
- un nombre entier aléatoire (format : "random:min,max")
|
||||
- une chaîne traduite (format : "translate:xxx")
|
||||
- déclaration d'une variable utilisateur (format : "define:nom,valeur")
|
||||
- une option (format : "fichier.section.option")
|
||||
- une variable locale du tampon
|
||||
- un hdata/variable (la valeur est automatiquement convertie en chaîne), par défaut "window" et "buffer" pointent vers la fenêtre et le tampon courants.
|
||||
Le format du hdata peut être le suivant :
|
||||
hdata.var1.var2... : démarrer avec un hdata (le pointeur doit être connu), et demander les variables l'une après l'autre (d'autres hdata peuvent être suivis)
|
||||
hdata[liste].var1.var2... : démarrer avec un hdata en utilisant une liste/pointeur/nom de pointeur, par exemple :
|
||||
@@ -1461,6 +1462,8 @@ Exemples (chaînes simples) :
|
||||
/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}} ==> --------
|
||||
|
||||
@@ -1410,35 +1410,36 @@ To force a string comparison, you can add double quotes around each expression,
|
||||
"50" > "100" ==> 1
|
||||
|
||||
Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
|
||||
1. the string itself without evaluation (format: "raw:xxx")
|
||||
2. a user-defined variable (format: "name")
|
||||
3. an evaluated sub-string (format: "eval:xxx")
|
||||
4. an evaluated condition (format: "eval_cond:xxx")
|
||||
5. a string with escaped chars (format: "esc:xxx" or "\xxx")
|
||||
6. a string converted to lower case (format: "lower:xxx")
|
||||
7. a string converted to upper case (format: "upper:xxx")
|
||||
8. a string with chars to hide (format: "hide:char,string")
|
||||
9. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
|
||||
- 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")
|
||||
10. a reversed string (format: "rev:xxx" or "revscr:xxx")
|
||||
11. a repeated string (format: "repeat:count,string")
|
||||
12. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
13. split of a string (format: "split:number,separators,flags,xxx")
|
||||
14. split of shell argmuents (format: "split_shell:number,xxx")
|
||||
15. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
16. a modifier (format: "modifier:name,data,string")
|
||||
17. an info (format: "info:name,arguments", arguments are optional)
|
||||
18. a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx")
|
||||
19. current date/time (format: "date" or "date:format")
|
||||
20. an environment variable (format: "env:XXX")
|
||||
21. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
22. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
23. a random integer number (format: "random:min,max")
|
||||
24. a translated string (format: "translate:xxx")
|
||||
25. define a user variable (format: "define:name,value")
|
||||
26. an option (format: "file.section.option")
|
||||
27. a local variable in buffer
|
||||
28. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
- 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:
|
||||
@@ -1461,6 +1462,8 @@ Examples (simple strings):
|
||||
/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}} ==> --------
|
||||
|
||||
@@ -1410,35 +1410,36 @@ To force a string comparison, you can add double quotes around each expression,
|
||||
"50" > "100" ==> 1
|
||||
|
||||
Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
|
||||
1. the string itself without evaluation (format: "raw:xxx")
|
||||
2. a user-defined variable (format: "name")
|
||||
3. an evaluated sub-string (format: "eval:xxx")
|
||||
4. an evaluated condition (format: "eval_cond:xxx")
|
||||
5. a string with escaped chars (format: "esc:xxx" or "\xxx")
|
||||
6. a string converted to lower case (format: "lower:xxx")
|
||||
7. a string converted to upper case (format: "upper:xxx")
|
||||
8. a string with chars to hide (format: "hide:char,string")
|
||||
9. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
|
||||
- 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")
|
||||
10. a reversed string (format: "rev:xxx" or "revscr:xxx")
|
||||
11. a repeated string (format: "repeat:count,string")
|
||||
12. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
13. split of a string (format: "split:number,separators,flags,xxx")
|
||||
14. split of shell argmuents (format: "split_shell:number,xxx")
|
||||
15. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
16. a modifier (format: "modifier:name,data,string")
|
||||
17. an info (format: "info:name,arguments", arguments are optional)
|
||||
18. a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx")
|
||||
19. current date/time (format: "date" or "date:format")
|
||||
20. an environment variable (format: "env:XXX")
|
||||
21. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
22. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
23. a random integer number (format: "random:min,max")
|
||||
24. a translated string (format: "translate:xxx")
|
||||
25. define a user variable (format: "define:name,value")
|
||||
26. an option (format: "file.section.option")
|
||||
27. a local variable in buffer
|
||||
28. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
- 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:
|
||||
@@ -1461,6 +1462,8 @@ Examples (simple strings):
|
||||
/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}} ==> --------
|
||||
|
||||
@@ -1409,35 +1409,36 @@ To force a string comparison, you can add double quotes around each expression,
|
||||
"50" > "100" ==> 1
|
||||
|
||||
Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
|
||||
1. the string itself without evaluation (format: "raw:xxx")
|
||||
2. a user-defined variable (format: "name")
|
||||
3. an evaluated sub-string (format: "eval:xxx")
|
||||
4. an evaluated condition (format: "eval_cond:xxx")
|
||||
5. a string with escaped chars (format: "esc:xxx" or "\xxx")
|
||||
6. a string converted to lower case (format: "lower:xxx")
|
||||
7. a string converted to upper case (format: "upper:xxx")
|
||||
8. a string with chars to hide (format: "hide:char,string")
|
||||
9. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
|
||||
- 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")
|
||||
10. a reversed string (format: "rev:xxx" or "revscr:xxx")
|
||||
11. a repeated string (format: "repeat:count,string")
|
||||
12. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
13. split of a string (format: "split:number,separators,flags,xxx")
|
||||
14. split of shell argmuents (format: "split_shell:number,xxx")
|
||||
15. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
16. a modifier (format: "modifier:name,data,string")
|
||||
17. an info (format: "info:name,arguments", arguments are optional)
|
||||
18. a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx")
|
||||
19. current date/time (format: "date" or "date:format")
|
||||
20. an environment variable (format: "env:XXX")
|
||||
21. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
22. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
23. a random integer number (format: "random:min,max")
|
||||
24. a translated string (format: "translate:xxx")
|
||||
25. define a user variable (format: "define:name,value")
|
||||
26. an option (format: "file.section.option")
|
||||
27. a local variable in buffer
|
||||
28. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
- 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:
|
||||
@@ -1460,6 +1461,8 @@ Examples (simple strings):
|
||||
/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}} ==> --------
|
||||
|
||||
@@ -1373,83 +1373,84 @@ infolists: исписује инфо о инфолистама
|
||||
/eval [-n|-s] [-d] <израз>
|
||||
[-n] [-d [-d]] -c <израз1> <оператор> <израз2>
|
||||
|
||||
-n: приказује резултат и не шаље га у бафер (дибаг режим)
|
||||
-s: дели израз пре израчунавања (многе команде могу да се раздвоје са тачка зарезима)
|
||||
-d: приказује дибаг излаз након израчунавања (са два -d: детаљнији дибаг)
|
||||
-c: израчунава као услов: користе се оператори и заграде, враћа логичку вредност („0” или „1”)
|
||||
израз: израз који се израчунава, променљиве у формату ${променљива} се замењују (погледајте испод); више команди може да се раздвоји са тачка зарезима
|
||||
оператор: логички или оператор поређења:
|
||||
- логички оператори:
|
||||
&& логичко „и”
|
||||
|| логичко „или”
|
||||
- оператори поређења:
|
||||
== једнако
|
||||
!= није једнако
|
||||
<= мање или једнако
|
||||
< мање
|
||||
>= веће или једнако
|
||||
> веће
|
||||
=~ подудара се са POSIX проширеним регуларним изразом
|
||||
!~ НЕ подудара се са POSIX проширеним регуларним изразом
|
||||
==* је маска подударања, разликује величину слова (дозвољен је џокер „*”)
|
||||
!!* НИЈЕ маска подударања, разликује величину слова (дозвољен је џокер „*”)
|
||||
=* је маска подударања, не разликује величину слова (дозвољен је џокер „*”)
|
||||
!* НИЈЕ маска подударања, не разликује величину слова (дозвољен је џокер „*”)
|
||||
==- је укључено, разликује величину слова
|
||||
!!- НИЈЕ укључено, разликује величину слова
|
||||
=- је укључено, не разликује величину слова
|
||||
!- НИЈЕ укључено, не разликује величину слова
|
||||
-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
|
||||
|
||||
Сматра се да је израз „true” ако није NULL, није празан и различит је од „0”.
|
||||
Поређење се врши употребом бројева у покретном зарезу ако су два израза важећи бројеви, у једном од следећих формата:
|
||||
- целобројни (примери: 5, -7)
|
||||
- број у покретном зарезу (примери: 5.2, -7.5, 2.83e-2)
|
||||
- хексадецимални број (примери: 0xA3, -0xA3)
|
||||
Ако желите да форсирате поређење стрингова, можете да додате знаке навода око сваког израза, на пример:
|
||||
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
|
||||
|
||||
У изразима се замењују неке променљиве, користећи формат ${променљива}, променљива може да буде, према редоследу приоритета:
|
||||
1. сам стринг без израчунавања (формат: „raw:xxx”)
|
||||
2. кориснички дефинисана променљива (формат: „име”)
|
||||
3. израчунати под-стринг (формат: „eval:xxx”)
|
||||
4. израчунати услов (формат: „eval_cond:xxx”)
|
||||
5. стринг са означеним карактерима (формат: „esc:xxx” или „\xxx”)
|
||||
6. стринг конвертован у мала слова (формат: "lower:xxx")
|
||||
7. стринг конвертован у велика слова (формат: "upper:xxx")
|
||||
8. стринг са карактерима за сакривање (формат: „hide:кар,стринг”)
|
||||
9. стринг са највише карактера (формат: „cut:макс,суфикс,стринг” или „cut:+макс,суфикс,стринг")
|
||||
или макс број карактера који се приказује на екрану (формат: „cutscr:макс,суфикс,стринг” или „cutscr:+макс,суфикс,стринг”)
|
||||
10. обрнути стринг (формат: „rev:xxx” или „revscr:xxx”)
|
||||
11. поновљени стринг (формат: „repeat:број,стринг”)
|
||||
12. дужина стринга (формат: „length:xxx” или „lengthscr:xxx”)
|
||||
13. подела стринга (формат: „split:број,сепаратори,заставице,xxx”)
|
||||
14. подела аргумената љуске (формат: „split_shell:број,xxx”)
|
||||
15. боја (формат: „color:xxx”, погледајте „Референтни приручник API додатака”, функција „color”)
|
||||
16. модификатор (формат: „modifier:име,подаци,стринг”)
|
||||
17. инфо (формат: „info:име,аргументи”, аргументи нису обавезни)
|
||||
18. base 16/32/64 шифриран/дешифрован стринг (формат: „base_encode:основа, xxx” или „base_decode:основа,xxx”)
|
||||
19. текући датум/време (формат: „date” или „date:формат”)
|
||||
20. променљива окружења (формат: „env:XXX”)
|
||||
21. тернарни оператор (формат: „if:услов?вредност_ако_је_тачно:вредност_ако_је_нетачно”)
|
||||
22. резултат израза са заградама и операторима + - * / // % ** (формат: „calc:xxx”)
|
||||
23. случајни целобројни број (формат: „random:мин,макс”)
|
||||
24. преведени стринг (формат: „translate:xxx”)
|
||||
25. дефиниција корисничке промонљиве (формат: „define:име,вредност”)
|
||||
26. опција (формат: „фајл.секција.опција”)
|
||||
27. локална променљива у баферу
|
||||
28. 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”.
|
||||
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)
|
||||
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
|
||||
@@ -1461,6 +1462,8 @@ infolists: исписује инфо о инфолистама
|
||||
/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}} ==> --------
|
||||
@@ -1486,7 +1489,7 @@ infolists: исписује инфо о инфолистама
|
||||
/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
|
||||
|
||||
Reference in New Issue
Block a user