Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Escaping of : in a _describe completion
- X-seq: zsh-users 14026
- From: Andrey Borzenkov <arvidjaar@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Escaping of : in a _describe completion
- Date: Sat, 11 Apr 2009 09:09:57 +0400
- Cc: Frank Blendinger <fb@xxxxxxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=EStg9Anm13D251KykSQcW5JiEwJ1SQzjSTmfeNX6j+E=; b=e2NSc1iYLh/EOCM2BXxF+GTNrK4hZpzwXkIXJZjb1YWbDFUef+F/XhIFo2azj72pl7 qbfB18Fj540uDWQuU7VsSVCdh1601yAdhOTraaLU2b0ExOmJCf9etQEYpBjBg1IHlSqQ 7MdORB+uNepNL/4kgaRpzy8eg6Z1LMDn6et/o=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=pfhy302QRpCR2WMLWHe2QBO4J1Dy7z6JfwCsiHC/uEILq5XukCMElHPz6wsBWdX/8m RPWyI1pER3n2QvfLeAkNwkRTNLY7kCKVVEbdPdnwu8wkAiJ2EsEhaNXEqxxqnck62f84 /nUSPuLEdEx9SaWKjjxy7rJJ166z7U9M3gVmY=
- In-reply-to: <20090411020319.GF4047@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090411020319.GF4047@xxxxxxxxxxxxxxxxxxx>
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