Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: which completion function are used for aliases?
- X-seq: zsh-users 10090
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: which completion function are used for aliases?
- Date: Sun, 26 Mar 2006 21:23:47 +0100
- In-reply-to: Message from Andy Spiegl <zsh.Andy@xxxxxxxxx> of "Sun, 26 Mar 2006 21:20:54 +0200." <20060326192054.GA27247@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Andy Spiegl wrote:
> Now, is it also possible to make zsh "know" the options of the alias,
> so that I don't have to hardcode the aliases in my completion function?
>
> But how can I get the details of the defined aliases???
>
> # Default directories (depending on which alias is used)
> if [[ -z $dir ]]; then
> if [[ $words[1] = gigaset2 ]]; then
> dir="/home/spiegl/movies/gigaset/PVR/"
> elif [[ $words[1] = gigaset3 ]]; then
> dir="/data2/movies/gigaset/PVR/"
> elif [[ $words[1] = gigaset-ext ]]; then
> dir="/extern-dos/Video/"
> else
> dir="/data/movies/gigaset/PVR/"
> fi
> fi
>
> PS:
> gigaset2='gigaset --dir /home/spiegl/movies/gigaset/PVR'
> gigaset3='gigaset --dir /data2/movies/gigaset/PVR'
> gigaset-ext='gigaset --dir /extern-dos/Video'
if [[ $aliases[$words[1]] = *" --dir "* ]]; then
dir=${aliases[$words[1]]##*--dir }
fi
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author