mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 08:13:14 +02:00
api: add support of evaluated sub-strings and current date/time in function string_eval_expression() and command /eval
This commit is contained in:
+11
-8
@@ -7190,15 +7190,17 @@ command_init ()
|
||||
"\n"
|
||||
"Some variables are replaced in expression, using the format "
|
||||
"${variable}, variable can be, by order of priority:\n"
|
||||
" 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n"
|
||||
" 2. a string with chars to hide (format: \"hide:char,string\")\n"
|
||||
" 3. a color (format: \"color:xxx\")\n"
|
||||
" 4. an info (format: \"info:name,arguments\", arguments are "
|
||||
" 1. an evaluated sub-string (format: \"eval:xxx\")\n"
|
||||
" 2. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n"
|
||||
" 3. a string with chars to hide (format: \"hide:char,string\")\n"
|
||||
" 4. a color (format: \"color:xxx\")\n"
|
||||
" 5. an info (format: \"info:name,arguments\", arguments are "
|
||||
"optional)\n"
|
||||
" 5. an environment variable (format: \"env:XXX\")\n"
|
||||
" 6. an option (format: \"file.section.option\")\n"
|
||||
" 7. a local variable in buffer\n"
|
||||
" 8. a hdata name/variable (the value is automatically converted "
|
||||
" 6. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 7. an environment variable (format: \"env:XXX\")\n"
|
||||
" 8. an option (format: \"file.section.option\")\n"
|
||||
" 9. a local variable in buffer\n"
|
||||
" 10. a hdata name/variable (the value is automatically converted "
|
||||
"to string), by default \"window\" and \"buffer\" point to current "
|
||||
"window/buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
@@ -7227,6 +7229,7 @@ command_init ()
|
||||
" /eval -n ${window.buffer.number} ==> 1\n"
|
||||
" /eval -n ${\\t} ==> <tab>\n"
|
||||
" /eval -n ${hide:-,${relay.network.password}} ==> --------\n"
|
||||
" /eval -n ${date:%H:%M:%S} ==> 07:46:40\n"
|
||||
"\n"
|
||||
"Examples (conditions):\n"
|
||||
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
|
||||
|
||||
Reference in New Issue
Block a user