~ubuntu-branches/ubuntu/precise/zsh/precise

« back to all changes in this revision

Viewing changes to Functions/Zftp/zfcd_match

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2011-01-09 23:10:24 UTC
  • mfrom: (2.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110109231024-7egfs040r26fq7fa
Tags: 4.3.11-1ubuntu1
* Merge from debian unstable. (LP: #700695) Remaining changes:
  - debian/zshrc: Enable completions by default, unless
    skip_global_compinit is set

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# function zfcd_match {
2
2
 
3
3
emulate -L zsh
 
4
setopt extendedglob
4
5
 
5
6
# see zfcd for details of this hack
6
7
if [[ $1 = $HOME || $1 = $HOME/* ]]; then
24
25
  fi
25
26
  # If we're using -F, we get away with using a directory
26
27
  # to list, but not a glob.  Don't ask me why.
27
 
  # I hate having to rely on awk here.
28
 
  zftp ls -LF $dir >$tmpf
29
 
  reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $tmpf))
30
 
  rm -f $tmpf
 
28
  reply=(${${(M)${(f)"$(zftp ls -lF $dir)"}:#d*}/(#b)*[[:space:]](*)\//$match[1]})
 
29
#  zftp ls -LF $dir >$tmpf
 
30
#  reply=($(awk '/\/$/ { print substr($1, 1, length($1)-1) }' $tmpf))
 
31
#  rm -f $tmpf
31
32
  [[ -n $dir && $dir != */ ]] && dir="$dir/"
32
33
  if [[ -n $WIDGET ]]; then
33
34
    _wanted directories expl 'remote directory' \