summary refs log tree commit diff
path: root/Completion/Unix/Command/_ncftp
blob: 763a61344acc5070e68bd35d170c367d5b9633c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#compdef ncftp lftp

local expl bookmarks XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

if [[ $service = lftp ]]; then
  bookmarks=$XDG_DATA_HOME/$service/bookmarks
else
  bookmarks=$HOME/.$service/bookmarks
fi

if [[ -f $bookmarks ]]; then
  bookmarks=(${"${(f)$(<$bookmarks)}"%%[[:space:],]*})
  [[ $service == ncftp ]] && shift 2 bookmarks  
  _wanted bookmarks expl bookmark compadd -a bookmarks && return 0
fi

_hosts