zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@sunsite.dk
Subject: Re: which completion function are used for aliases?
Date: Sun, 26 Mar 2006 21:23:47 +0100	[thread overview]
Message-ID: <200603262023.k2QKNlaG006386@pwslaptop.csr.com> (raw)
In-Reply-To: Message from Andy Spiegl <zsh.Andy@spiegl.de>  of "Sun, 26 Mar 2006 21:20:54 +0200." <20060326192054.GA27247@spiegl.de>

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@ntlworld.com>
Web page still at http://www.pwstephenson.fsnet.co.uk/


  reply	other threads:[~2006-03-26 20:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25  0:08 Andy Spiegl
2006-03-25 18:31 ` Bart Schaefer
2006-03-26 19:20   ` Andy Spiegl
2006-03-26 20:23     ` Peter Stephenson [this message]
2006-03-27  9:30       ` Andy Spiegl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603262023.k2QKNlaG006386@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).