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

Re: Escaping of : in a _describe completion



Hi.

On Sat 2009-04-11 09:09, Andrey Borzenkov <arvidjaar@xxxxxxxxx>
proclaimed:
> 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')

Thanks for your suggestion, but that does not work either. It will
complete the leading ``00:'' part, but then it stops. Pressing <Tab>
again after that won't bring up the completion menu, as zsh does for my
other completions, even if I manually enter a `0' or `1' to distinguish
the both available arguments.


Greetings,
Frank

-- 
Frank Blendinger | fb(at)intoxicatedmind.net | GPG: 0x0BF2FE7A
Fingerprint: BB64 F2B8 DFD8 BF90 0F2E 892B 72CF 7A41 0BF2 FE7A

Attachment: signature.asc
Description: Digital signature



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