diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-04-15 10:15:17 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-04-15 10:15:17 +0200 |
commit | d9425f37655fed57f83af02d3fcb9d31d590f38c (patch) | |
tree | 30ec7d70a34b09c8fca5d791a7bba63b792a20aa /doc | |
parent | c1dee726d51d3dea0d4e5d481b54279a0c7f82c3 (diff) | |
download | weechat-d9425f37655fed57f83af02d3fcb9d31d590f38c.zip |
core: add example of secured data in /help eval
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/autogen/user/weechat_commands.adoc | 121 | ||||
-rw-r--r-- | doc/en/autogen/user/weechat_commands.adoc | 1 | ||||
-rw-r--r-- | doc/fr/autogen/user/weechat_commands.adoc | 1 | ||||
-rw-r--r-- | doc/it/autogen/user/weechat_commands.adoc | 1 | ||||
-rw-r--r-- | doc/ja/autogen/user/weechat_commands.adoc | 103 | ||||
-rw-r--r-- | doc/pl/autogen/user/weechat_commands.adoc | 103 |
6 files changed, 168 insertions, 162 deletions
diff --git a/doc/de/autogen/user/weechat_commands.adoc b/doc/de/autogen/user/weechat_commands.adoc index 8d9de2486..0ba87d798 100644 --- a/doc/de/autogen/user/weechat_commands.adoc +++ b/doc/de/autogen/user/weechat_commands.adoc @@ -261,62 +261,63 @@ infolists: zeigt Information über die Infolists an /eval [-n|-s] <expression> [-n] -c <expression1> <operator> <expression2> - -n: gibt das Ergebnis aus, ohne das dieses in den Buffer gesendet wird (debug Modus) - -s: teilt Ausdrücke bevor sie evaluiert werden (mehrere Befehle können durch Semikolon getrennt werden) - -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) - -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 sofern es sich bei beiden Ausdrücken um gültige Nummer handelt, die folgendes Format haben müssen: - - 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) + -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 (wildcard "*" is allowed) + !* is NOT matching mask (wildcard "*" is allowed) + +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. eine evaluierte Teilzeichenkette (Format: "eval:xxx") - 2. eine Zeichenkette mit Escapesequenzen (Format: "esc:xxx" oder "\xxx") - 3. Zeichen welche in einer Zeichenkette nicht dargestellt werden sollen (Format: "hide:Zeichen,Zeichenkette") - 4. eine Zeichenkette mit einer maximalen Anzahl an Zeichen (Format: "cut:+Max,Suffix,Zeichenkette") - oder maximale Anzahl an Zeichen die auf dem Bildschirm angezeigt werden sollen (Format: "cutscr:Max,Suffix,Zeichenkette oder "cutscr:+Max,Suffix,Zeichenkette") - 5. eine Farbe (Format: "color:xxx", siehe "Anleitung für API Erweiterung", Funktion "color")\n - 6. eine Info (Format: "info:Name,Argumente", Argumente sind optional) - 7. aktuelles Datum/Uhrzeit (Format: "date" oder "date:format") - 8. eine Umgebungsvariable (Format: "env:XXX") - 9. ein Dreifachoperand (Format: "if:Bedingung?Wert_falls_wahr:Wert_falls_unwahr") - 10. eine Option (Format: "file.section.option") - 11. der Name einer lokalen Variablen eines Buffer - 12. ein 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) -Die vorhandenen Namen für hdata und Variablen sind in der "Anleitung für API Erweiterung", Bereich "weechat_hdata_get". beschrieben - -Beispiele (einfache Zeichenketten): +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + 1. an evaluated sub-string (format: "eval:xxx") + 2. a string with escaped chars (format: "esc:xxx" or "\xxx") + 3. a string with chars to hide (format: "hide:char,string") + 4. 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") + 5. a color (format: "color:xxx", see "Plugin API reference", function "color") + 6. an info (format: "info:name,arguments", arguments are optional) + 7. current date/time (format: "date" or "date:format") + 8. an environment variable (format: "env:XXX") + 9. a ternary operator (format: "if:condition?value_if_true:value_if_false") + 10. an option (format: "file.section.option") + 11. a local variable in buffer + 12. 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, 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) +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): /eval -n ${info:version} ==> 0.4.3 /eval -n ${env:HOME} ==> /home/user /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.freenode_password} ==> secret /eval -n ${window} ==> 0x2549aa0 /eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer.full_name} ==> core.weechat @@ -328,16 +329,16 @@ Beispiele (einfache Zeichenketten): /eval -n ${date:%H:%M:%S} ==> 07:46:40 /eval -n ${if:${info:term_width}>80?big:small} ==> big -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 +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 ---- [[command_weechat_filter]] diff --git a/doc/en/autogen/user/weechat_commands.adoc b/doc/en/autogen/user/weechat_commands.adoc index 0d00acb7b..855a759d5 100644 --- a/doc/en/autogen/user/weechat_commands.adoc +++ b/doc/en/autogen/user/weechat_commands.adoc @@ -317,6 +317,7 @@ Examples (simple strings): /eval -n ${info:version} ==> 0.4.3 /eval -n ${env:HOME} ==> /home/user /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.freenode_password} ==> secret /eval -n ${window} ==> 0x2549aa0 /eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer.full_name} ==> core.weechat diff --git a/doc/fr/autogen/user/weechat_commands.adoc b/doc/fr/autogen/user/weechat_commands.adoc index d65c657db..34cc671cf 100644 --- a/doc/fr/autogen/user/weechat_commands.adoc +++ b/doc/fr/autogen/user/weechat_commands.adoc @@ -317,6 +317,7 @@ Exemples (chaînes simples) : /eval -n ${info:version} ==> 0.4.3 /eval -n ${env:HOME} ==> /home/user /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.freenode_password} ==> secret /eval -n ${window} ==> 0x2549aa0 /eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer.full_name} ==> core.weechat diff --git a/doc/it/autogen/user/weechat_commands.adoc b/doc/it/autogen/user/weechat_commands.adoc index 1c69a88a9..62e977628 100644 --- a/doc/it/autogen/user/weechat_commands.adoc +++ b/doc/it/autogen/user/weechat_commands.adoc @@ -317,6 +317,7 @@ Examples (simple strings): /eval -n ${info:version} ==> 0.4.3 /eval -n ${env:HOME} ==> /home/user /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.freenode_password} ==> secret /eval -n ${window} ==> 0x2549aa0 /eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer.full_name} ==> core.weechat diff --git a/doc/ja/autogen/user/weechat_commands.adoc b/doc/ja/autogen/user/weechat_commands.adoc index 7bf69069d..c19f06d5b 100644 --- a/doc/ja/autogen/user/weechat_commands.adoc +++ b/doc/ja/autogen/user/weechat_commands.adoc @@ -261,62 +261,63 @@ infolists: インフォリストに関する情報を表示 /eval [-n|-s] <expression> [-n] -c <expression1> <operator> <expression2> - -n: 結果をバッファに送信せずに表示 (デバッグモード) - -s: 評価前に式を分割する (複数のコマンドを指定する場合はセミコロンで区切ってください) - -c: 条件として評価: 演算子と括弧をを使い、ブール値 ("0" または "1") を返します -expression: 評価する式、${variable} 型の書式の変数は置換されます (以下を参照してください); 複数のコマンドを指定する場合はセミコロンで区切ってください - operator: 論理演算子や比較演算子: - - 論理演算子: - && ブール演算の "and" - || ブール演算の "or" - - 比較演算子: - == 等しい - != 等しくない - <= 以下 - < より少ない - >= 以上 - > より大きい - =~ POSIX 拡張正規表現にマッチ - !~ POSIX 拡張正規表現にマッチしない - =* マスクにマッチ (ワイルドカード "*" を使えます) - !* マスクにマッチしない (ワイルドカード "*" を使えます) - -式が NULL でない場合、空でない場合、"0" でない場合、式は "真" と評価されます。 -浮動小数点数として比較される数値表現の書式は以下です: - - 整数 (例: 5、-7) - - 浮動小数点数 (例: 5.2、-7.5、2.83e-2) - - 16 進数 (例: 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) + -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 (wildcard "*" is allowed) + !* is NOT matching mask (wildcard "*" is allowed) + +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 -式中の ${variable} 型の書式の変数は置換されます。変数は以下の優先順位に従います: - 1. 評価済みのサブ文字列 (書式: "eval:xxx") - 2. エスケープ文字を含む文字列 (書式: "esc:xxx" または "\xxx") - 3. 隠す文字を含む文字列 (書式: "hide:char,string") - 4. 最大文字数を指定した文字列 (書式: "cut:max,suffix,string" または "cut:+max,suffix,string") - または最大文字表示幅を指定した文字列 (書式: "cutscr:max,suffix,string" または "cutscr:+max,suffix,string") - 5. 色 (書式: "color:xxx"、"プラグイン API リファレンス" の "color" 関数を参照してください) - 6. 情報 (書式: "info:name,arguments"、arguments は任意) - 7. 現在の日付/時刻 (書式: "date" または "date:format") - 8. 環境変数 (書式: "env:XXX") - 9. 三項演算子 (書式: "if:condition?value_if_true:value_if_false") - 10. オプション (書式: "file.section.option") - 11. バッファのローカル変数 - 12. hdata の名前/変数 (値は自動的に文字列に変換されます)、デフォルトでは "window" と "buffer" は現在のウィンドウ/バッファを指します。 -hdata の書式は以下の 1 つです: - hdata.var1.var2...: hdata (ポインタは既知) で開始し、1 個ずつ変数を続ける (他の hdata を続けることも可能) - hdata[list].var1.var2...: リストを使う hdata で開始する、例: - ${buffer[gui_buffers].full_name}: バッファリストにリンクされた最初のバッファのフルネーム - ${plugin[weechat_plugins].name}: プラグインリストにリンクされた最初のプラグインの名前 - hdata[pointer].var1.var2...: ポインタを使う hdata で開始する、例: - ${buffer[0x1234abcd].full_name}: 与えたポインタを持つバッファの完全な名前 (トリガ中で使うことが可能です) -hdata と変数の名前については、"プラグイン API リファレンス" の "weechat_hdata_get" 関数を参照してください。 - -例 (単純な文字列): +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + 1. an evaluated sub-string (format: "eval:xxx") + 2. a string with escaped chars (format: "esc:xxx" or "\xxx") + 3. a string with chars to hide (format: "hide:char,string") + 4. 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") + 5. a color (format: "color:xxx", see "Plugin API reference", function "color") + 6. an info (format: "info:name,arguments", arguments are optional) + 7. current date/time (format: "date" or "date:format") + 8. an environment variable (format: "env:XXX") + 9. a ternary operator (format: "if:condition?value_if_true:value_if_false") + 10. an option (format: "file.section.option") + 11. a local variable in buffer + 12. 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, 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) +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): /eval -n ${info:version} ==> 0.4.3 /eval -n ${env:HOME} ==> /home/user /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.freenode_password} ==> secret /eval -n ${window} ==> 0x2549aa0 /eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer.full_name} ==> core.weechat @@ -328,7 +329,7 @@ hdata と変数の名前については、"プラグイン API リファレン /eval -n ${date:%H:%M:%S} ==> 07:46:40 /eval -n ${if:${info:term_width}>80?big:small} ==> big -例 (条件): +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/pl/autogen/user/weechat_commands.adoc b/doc/pl/autogen/user/weechat_commands.adoc index 0466ec11e..6d0afbf17 100644 --- a/doc/pl/autogen/user/weechat_commands.adoc +++ b/doc/pl/autogen/user/weechat_commands.adoc @@ -261,62 +261,63 @@ infolists: wyświetla informacje o infolistach /eval [-n|-s] <wyrażenie> [-n] -c <wyrażenie1> <operator> <wyrażenie2> - -n: wyświetla wynik bez wysyłania go do buforu (tryb debugowania) - -s: podziel wyażenie przed przetworzeniem go (wiele komend może być oddzielonych średnikami) - -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: - && boolowskie "i" - || boolowskie "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 (dzika karta "*" dozwolona) - !* NIE pasuje do maski (dzika karta "*" dozwolona) - -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 załkowite (przykłady: 5, -7) - - liczby zmiennoprzecinkowe (przykłady: 5.2, -7.5, 2.83e-2) - - liczby szestnastkowe (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) + -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 (wildcard "*" is allowed) + !* is NOT matching mask (wildcard "*" is allowed) + +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ć: - 1. przetworzony ciąg (format: "eval:xxx") - 2. ciąg z wyescapowanymi znakami (format: "esc:xxx" lub "\xxx") - 3. ciąg ze znakami do ukrycia (format: "hide:char,string") - 4. 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") - 5. kolor (format color:xxx) - 6. informacja (format: "info:nazwa,argumenty", argumenty są opcjonalne) - 7. obecna data/czas (format: "date" lub "date:format") - 8. zmienna środowiskowa (format: "env:XXX") - 9. wyrażenie warunkowe (format: "if:condition?value_if_true:value_if_false") - 10. opcja (format: plik.sekcja.opcja) - 11. zmienna lokalna w buforze - 12. 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) -Nazwy hdata i zmiennych, można znaleźć w "Opisie API wtyczek", fukcja "weechat_hdata_get". - -Przykłady (proste ciągi): +Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority: + 1. an evaluated sub-string (format: "eval:xxx") + 2. a string with escaped chars (format: "esc:xxx" or "\xxx") + 3. a string with chars to hide (format: "hide:char,string") + 4. 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") + 5. a color (format: "color:xxx", see "Plugin API reference", function "color") + 6. an info (format: "info:name,arguments", arguments are optional) + 7. current date/time (format: "date" or "date:format") + 8. an environment variable (format: "env:XXX") + 9. a ternary operator (format: "if:condition?value_if_true:value_if_false") + 10. an option (format: "file.section.option") + 11. a local variable in buffer + 12. 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, 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) +For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". + +Examples (simple strings): /eval -n ${info:version} ==> 0.4.3 /eval -n ${env:HOME} ==> /home/user /eval -n ${weechat.look.scroll_amount} ==> 3 + /eval -n ${sec.data.freenode_password} ==> secret /eval -n ${window} ==> 0x2549aa0 /eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer.full_name} ==> core.weechat @@ -328,7 +329,7 @@ Przykłady (proste ciągi): /eval -n ${date:%H:%M:%S} ==> 07:46:40 /eval -n ${if:${info:term_width}>80?big:small} ==> big -Przykłady (warunki): +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 |