Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: which completion function are used for aliases?



Hi Bart,

> Try "unsetopt complete_aliases".
Aaah, interesting!  I guess I added this option a long time ago
and had forgotten about it, but the name of the option really is
a bit confusing. :-)

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???

Right now, my completion function uses this code:
---------------
local dir=${words[(r)--dir=*]##--dir=}
if [[ -z $dir ]]; then
  integer dirind=${words[(i)--dir]}
  if (( dirind )); then
    dir=$words[dirind+1]
  fi
fi

# 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
--------------

Thx,
 Andy.

PS:
 gigaset2='gigaset --dir /home/spiegl/movies/gigaset/PVR'
 gigaset3='gigaset --dir /data2/movies/gigaset/PVR'
 gigaset-ext='gigaset --dir /extern-dos/Video'

-- 
 New Windows XP error message:
   "File not found. Should I fake it? (Y/N)"



Messages sorted by: Reverse Date, Date, Thread, Author