summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-03-10 20:46:47 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-03-10 20:52:28 +0100
commit5f5535b466c281febaab89960c735ad7d4ff5506 (patch)
tree66cb40b751537d8395903571cb8a13e9440b181e /src/core
parenteb71880e18cee8299848d4c387f0df06d134f95c (diff)
downloadweechat-5f5535b466c281febaab89960c735ad7d4ff5506.zip
core: simplify /help eval, move examples with the other examples (issue #1888)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-command.c85
1 files changed, 42 insertions, 43 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 365f3a211..10d40036c 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -8013,53 +8013,52 @@ command_init ()
"with this pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer "
"with this pointer name (can be used in triggers)\n"
- " hdata[pointer].var1.keys_values(): When var1 is a hashtable, "
- "methods \"keys(),values(),keys_sorted(),keys_values(),"
- "keys_values_sorted()\" may be called. Alternatively, a key can "
- "be looked up directly. For example:\n"
- " ${buffer[gui_buffers].local_variables.keys_values()}: plugin:core,name:weechat\n"
- " ${buffer[gui_buffers].local_variables.plugin}: core\n"
+ " hdata[pointer].var1.method(): when var1 is a hashtable, methods "
+ "\"keys()\", \"values()\", \"keys_sorted()\", \"keys_values()\" "
+ "and \"keys_values_sorted()\" can be called\n"
"For name of hdata and variables, please look at \"Plugin API "
"reference\", function \"weechat_hdata_get\".\n"
"\n"
"Examples (simple strings):\n"
- " /eval -n ${raw:${info:version}} ==> ${info:version}\n"
- " /eval -n ${eval_cond:${window.win_width}>100} ==> 1\n"
- " /eval -n ${info:version} ==> 0.4.3\n"
- " /eval -n ${env:HOME} ==> /home/user\n"
- " /eval -n ${weechat.look.scroll_amount} ==> 3\n"
- " /eval -n ${sec.data.password} ==> secret\n"
- " /eval -n ${window} ==> 0x2549aa0\n"
- " /eval -n ${window.buffer} ==> 0x2549320\n"
- " /eval -n ${window.buffer.full_name} ==> core.weechat\n"
- " /eval -n ${window.buffer.number} ==> 1\n"
- " /eval -n ${\\t} ==> <tab>\n"
- " /eval -n ${chars:digit} ==> 0123456789\n"
- " /eval -n ${chars:J-T} ==> JKLMNOPQRST\n"
- " /eval -n ${lower:TEST} ==> test\n"
- " /eval -n ${upper:test} ==> TEST\n"
- " /eval -n ${hide:-,${relay.network.password}} ==> --------\n"
- " /eval -n ${cut:3,+,test} ==> tes+\n"
- " /eval -n ${cut:+3,+,test} ==> te+\n"
- " /eval -n ${date:%H:%M:%S} ==> 07:46:40\n"
- " /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
- " /eval -n ${rev:Hello} ==> olleH\n"
- " /eval -n ${repeat:5,-} ==> -----\n"
- " /eval -n ${length:test} ==> 4\n"
- " /eval -n ${split:1,,,abc,def,ghi} ==> abc\n"
- " /eval -n ${split:-1,,,abc,def,ghi} ==> ghi\n"
- " /eval -n ${split:count,,,abc,def,ghi} ==> 3\n"
- " /eval -n ${split:random,,,abc,def,ghi} ==> def\n"
- " /eval -n ${split_shell:1,\"arg 1\" arg2} ==> arg 1\n"
- " /eval -n ${split_shell:-1,\"arg 1\" arg2} ==> arg2\n"
- " /eval -n ${split_shell:count,\"arg 1\" arg2} ==> 2\n"
- " /eval -n ${split_shell:random,\"arg 1\" arg2} ==> arg2\n"
- " /eval -n ${calc:(5+2)*3} ==> 21\n"
- " /eval -n ${random:0,10} ==> 3\n"
- " /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
- " /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
- " /eval -n ${translate:Plugin} ==> Extension\n"
- " /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8\n"
+ " /eval -n ${raw:${info:version}} ==> ${info:version}\n"
+ " /eval -n ${eval_cond:${window.win_width}>100} ==> 1\n"
+ " /eval -n ${info:version} ==> 0.4.3\n"
+ " /eval -n ${env:HOME} ==> /home/user\n"
+ " /eval -n ${weechat.look.scroll_amount} ==> 3\n"
+ " /eval -n ${sec.data.password} ==> secret\n"
+ " /eval -n ${window} ==> 0x2549aa0\n"
+ " /eval -n ${window.buffer} ==> 0x2549320\n"
+ " /eval -n ${window.buffer.full_name} ==> core.weechat\n"
+ " /eval -n ${window.buffer.number} ==> 1\n"
+ " /eval -n ${buffer.local_variables.keys_values()} ==> plugin:core,name:weechat\n"
+ " /eval -n ${buffer.local_variables.plugin} ==> core\n"
+ " /eval -n ${\\t} ==> <tab>\n"
+ " /eval -n ${chars:digit} ==> 0123456789\n"
+ " /eval -n ${chars:J-T} ==> JKLMNOPQRST\n"
+ " /eval -n ${lower:TEST} ==> test\n"
+ " /eval -n ${upper:test} ==> TEST\n"
+ " /eval -n ${hide:-,${relay.network.password}} ==> --------\n"
+ " /eval -n ${cut:3,+,test} ==> tes+\n"
+ " /eval -n ${cut:+3,+,test} ==> te+\n"
+ " /eval -n ${date:%H:%M:%S} ==> 07:46:40\n"
+ " /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
+ " /eval -n ${rev:Hello} ==> olleH\n"
+ " /eval -n ${repeat:5,-} ==> -----\n"
+ " /eval -n ${length:test} ==> 4\n"
+ " /eval -n ${split:1,,,abc,def,ghi} ==> abc\n"
+ " /eval -n ${split:-1,,,abc,def,ghi} ==> ghi\n"
+ " /eval -n ${split:count,,,abc,def,ghi} ==> 3\n"
+ " /eval -n ${split:random,,,abc,def,ghi} ==> def\n"
+ " /eval -n ${split_shell:1,\"arg 1\" arg2} ==> arg 1\n"
+ " /eval -n ${split_shell:-1,\"arg 1\" arg2} ==> arg2\n"
+ " /eval -n ${split_shell:count,\"arg 1\" arg2} ==> 2\n"
+ " /eval -n ${split_shell:random,\"arg 1\" arg2} ==> arg2\n"
+ " /eval -n ${calc:(5+2)*3} ==> 21\n"
+ " /eval -n ${random:0,10} ==> 3\n"
+ " /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
+ " /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
+ " /eval -n ${translate:Plugin} ==> Extension\n"
+ " /eval -n ${define:len,${calc:5+3}}${len}x${len} ==> 8x8\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"