Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Completer help wanted
- X-seq: zsh-users 13790
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Completer help wanted
- Date: Sat, 31 Jan 2009 19:55:31 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=qQ6H/bE3aaeli6tGaqn5LcH40yyPkFo2xKnW8LolooM=; b=AA+fpYCuDrwWwGFxPgFE5FiMeuyAAPk0kLuYr0kkxvQgUe5xSML4LE3wnlQKZjZmdi 45QV53P0bJoJWizJl4I8dpaweWZyS+sEXBHniu4NJEDPS9MZPrTSlvuyBMMS16/2qIzp u/nPXEpOnPch2aNg8J70hJ41mt/t3uYVtap8A=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=jY8ERu+XE+dag+oxI/gf+HDq4loSsbBU0kZZa5ycZMSJF9dr/0wRwKnMJgluv+5/an bM5GEtQxz/2pg3VDsi+0D9o9nOoiPGbZUzn9APcE9/sm2L5viZy6MFWs8rTNzWKgzv+B 8xuzh4Mkqo/zB0etxDTsyyLk6vzOA8OpIi3QY=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi,
I want to write a _use that lets me complete USE=<tab> on gentoo. I already
have a _gentoo_packages (which I didn't write) that does it for euse and
other commands, with code that looks like this:
_gentoo_packages_update_useflag(){
local flags PORTDIR
var=PORTDIR
[[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"
[[ -z ${(P)var} && -r /etc/make.globals ]] &&
local $var="`. /etc/make.globals 2>/dev/null; echo ${(P)var}`"
flags=( ${${(M)${(f)"$(<$PORTDIR/profiles/use.desc)"}:#* - *}%% - *}
${${${(M)${(f)"$(<$PORTDIR/profiles/use.local.desc)"}#* - *}%% - *}#*:} )
compadd $flags
}
I would not be averse to copying it instead of calling it. This is what
I got so far,
#compdef -value-,USE,-default-
_gentoo_packages useflag
But it only completes one useflag and goes away. I want to complete several,
and have them separated by spaces. I looked at the $PATH completer but it uses
internal _path_files magic which didn't help much.
Thanks,
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author