From 390e7b169f12fef84fe889d4772d738f6a1e1e9a Mon Sep 17 00:00:00 2001 From: Joe Bloggs Date: Tue, 25 Mar 2014 23:23:15 +0000 Subject: [PATCH] update --- zsh-completions-howto.org | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zsh-completions-howto.org b/zsh-completions-howto.org index 9a0c8a3..f75de94 100644 --- a/zsh-completions-howto.org +++ b/zsh-completions-howto.org @@ -141,9 +141,13 @@ For example: #+BEGIN_SRC sh _alternative 'args:custom args:(a b c)' 'interfaces:network interfaces:_net_interfaces' #+END_SRC -The first specification 'args:custom args:(a b c)' adds completion candidates a, b & c with description -'custom args'. The second specification calls the _net_interfaces command which adds network interfaces as completion -candidates. +The first specification adds completion candidates a, b & c with description 'custom args', and the second specification +calls the _net_interfaces command which adds network interfaces as completion candidates. + +We could add descriptions to each of the custom args like this: +#+BEGIN_SRC sh +_alternative 'args:custom args:((a\:"description a" b\:"description b" c\:"description c"))' 'interfaces:network interfaces:_net_interfaces' +#+END_SRC ** Writing completion functions using _arguments The _arguments function makes it easy to create completion functions.