summaryrefslogtreecommitdiff
path: root/doc/en/dev
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-05-08 10:31:15 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-05-08 10:31:15 +0200
commit2783b512015e0a42b528042a218d0e3a8843b7e5 (patch)
tree9d5e89652388f3615e7383ea0c913946cf85d1c6 /doc/en/dev
parentd3976c2afe608d70724e2d3d59093b6fbb3d230a (diff)
downloadweechat-2783b512015e0a42b528042a218d0e3a8843b7e5.zip
Improve completion: allow a command to use completion of another command (used by alias plugin)
Diffstat (limited to 'doc/en/dev')
-rw-r--r--doc/en/dev/plugin_c_api.en.xml33
1 files changed, 27 insertions, 6 deletions
diff --git a/doc/en/dev/plugin_c_api.en.xml b/doc/en/dev/plugin_c_api.en.xml
index 211163bdf..538828c09 100644
--- a/doc/en/dev/plugin_c_api.en.xml
+++ b/doc/en/dev/plugin_c_api.en.xml
@@ -5034,6 +5034,7 @@ struct t_hook *weechat_hook_command (
<option>completion</option>: completion template for command:
list of completions for each arguments, separated by space. Many
completions are possible for one argument, separated by "|".
+ Many templates are possible for same command, separeted by "||".
Default completion codes are:
<informaltable colsep="0" frame="none">
<tgroup cols="3">
@@ -5060,6 +5061,10 @@ struct t_hook *weechat_hook_command (
</thead>
<tbody>
<row>
+ <entry>%%command</entry>
+ <entry>Reuse completion template from /command</entry>
+ </row>
+ <row>
<entry>%-</entry>
<entry>Stop completion</entry>
</row>
@@ -5151,13 +5156,29 @@ my_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
return WEECHAT_RC_OK;
}
+/* this is an example, inspired by weechat command /filter */
struct t_hook *my_command_hook =
- weechat_hook_command ("mycommand",
- "description of my command",
- "[command [buffer]]",
- "command: WeeChat or plugin command\n"
- " buffer: buffer name",
- "%w|%p %b", &amp;my_command_cb, NULL);
+ weechat_hook_command (/* command name */
+ "myfilter",
+ /* description */
+ "description of myfilter",
+ /* args */
+ "[list] | [enable|disable|toggle [name]] | "
+ "[add name plugin.buffer tags regex] | "
+ "[del name|-all]",
+ /* args description */
+ "description of arguments...",
+ /* completion */
+ "list"
+ " || enable %(filters_names)"
+ " || disable %(filters_names)"
+ " || toggle %(filters_names)"
+ " || add %(filters_names) %(buffers_plugins_names)|*"
+ " || del %(filters_names)|-all",
+ /* callback */
+ &amp;my_command_cb,
+ /* callback_data */
+ NULL);
</screen>
</para>
</section>