Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Escaping of : in a _describe completion



On Saturday 11 of April 2009 06:03:19 Frank Blendinger wrote:
> Hi,
>
> I am trying to build a small completion for etherwake, which gives me
> some MAC addresses together with their hostnames as descriptions. I
> came up with something like this:
>
>     _etherwake() {
>         typeset -a etherwake_desc;
>        
> etherwake_desc=("00:0c:6e:74:16:77:host1";"00:1b:63:31:4a:6b:host2");
> _describe etherwake etherwake_desc;
>     }
>     compdef _etherwake etherwake
>
> This does not work, however, as the first `:' of each string in the
> etherwake_desc array is used to separate the completion from the
> description. I tried escaping the `:' characters of the MAC addresses
> with `\', which did not help. Neither did putting ' or \" around the
> MAC addresses.
>
> How can I do it right?
>

etherwake_desc=('00\:0c\:6e\:74\:16\:77:host1' 
'00\:1b\:63\:31\:4a\:6b:host2')

You do not need all those semicolons on line ends BTW.

Attachment: signature.asc
Description: This is a digitally signed message part.



Messages sorted by: Reverse Date, Date, Thread, Author