home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Shells / zsh-3.0.5-MIHS / src / Functions / cdmatch2 < prev    next >
Encoding:
Text File  |  1996-10-10  |  378 b   |  16 lines

  1. # This function should be called from compctl to complete the
  2. # second argument of cd and pushd.
  3.  
  4. emulate -R zsh                # Requires zsh 3.0-pre4 or later
  5. setopt localoptions
  6. local from
  7.  
  8. read -Ac from
  9. from="${from[2]}"
  10.  
  11. eval "reply=( \${PWD:s@$from@$1*$2@}~$PWD(ND-/:) )"
  12. reply=( "${${reply[@]#${PWD%%$from*}}%${PWD#*$from}}" )
  13. [[ ${#reply[(r),-1]} != 0 ]] && reply[(r)]="''"
  14.  
  15. return
  16.