From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20490 invoked from network); 5 Feb 2002 10:02:31 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Feb 2002 10:02:31 -0000 Received: (qmail 1854 invoked by alias); 5 Feb 2002 10:02:13 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4647 Received: (qmail 1825 invoked from network); 5 Feb 2002 10:02:12 -0000 Message-ID: <20020205100209.37738.qmail@web9305.mail.yahoo.com> Date: Tue, 5 Feb 2002 10:02:09 +0000 (GMT) From: =?iso-8859-1?q?Oliver=20Kiddle?= Subject: Re: Can someone help me convert compctl to zstyle, please. To: Rik Cc: zsh-users@sunsite.dk In-Reply-To: <20020205031811.GA29284@spoon.pkl.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit --- Rik wrote: > Hello everyone, > > I'm having problems with zstyle. TO be perfectly honest, I've not > managed to actually get it to do anthing, which means I have missed > something. Have you at least run compinit? (You need autoload -U compinit;compinit in your .zshrc or run compinstall similarly from the command line). > I used to use: > listsysctls () { set -A reply $(sysctl -AN ${1%.*}) } > compctl -K listsysctls sysctl There is already a pre-written completion for sysctl so this should already work. If it didn't, you could do: _sysctl { compadd $(sysctl -AN ${1%.*}) } compdef _sysctl sysctl > ssh_common=( {,root@}mail.mynetwork.com {,root@}www.mynetwork.com ) > compctl -K ssh_common ssh scp Here you need something like: zstyle ':completion:*:*:(ssh|scp):*:my-accounts' users-hosts \ root@mail.mynetwork.com root@www.mynetwork.com Again a completion for ssh has already been written so all the options should be working. It looks up this style to find out your ssh accounts. > My basic problem is that an hour of staring at the man page, even > with > examples, has not helped in the slightest. Peter has written a user-guide which has a good chapter on the new completion system. You might find it easier than the manual. It is available at http://zsh.sunsite.dk/Guide/zshguide.html Oliver __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com