2001-04-02 13:24:49 +02:00
|
|
|
#compdef -tilde-
|
|
|
|
|
|
|
|
# We use all named directories and user names here. If this is too slow
|
|
|
|
# for you or if there are too many of them, you may want to use
|
|
|
|
# `compadd -qS/ -a friends' or something like that.
|
|
|
|
|
|
|
|
[[ -n "$compstate[quote]" ]] && return 1
|
|
|
|
|
2001-07-02 09:17:00 +02:00
|
|
|
local expl suf ret=1
|
2001-04-02 13:24:49 +02:00
|
|
|
|
|
|
|
if [[ "$SUFFIX" = */* ]]; then
|
|
|
|
ISUFFIX="/${SUFFIX#*/}$ISUFFIX"
|
|
|
|
SUFFIX="${SUFFIX%%/*}"
|
|
|
|
suf=(-S '')
|
|
|
|
else
|
|
|
|
suf=(-qS/)
|
|
|
|
fi
|
|
|
|
|
|
|
|
_tags users named-directories directory-stack
|
|
|
|
|
|
|
|
while _tags; do
|
|
|
|
_requested users && _users "$suf[@]" "$@" && ret=0
|
|
|
|
|
|
|
|
_requested named-directories expl 'named directory' \
|
2003-04-18 19:15:34 +02:00
|
|
|
compadd "$suf[@]" "$@" -k nameddirs && ret=0
|
2001-04-02 13:24:49 +02:00
|
|
|
|
|
|
|
_requested directory-stack && _directory_stack "$suf[@]" && ret=0
|
|
|
|
|
|
|
|
(( ret )) || return 0
|
|
|
|
done
|
2001-07-02 09:17:00 +02:00
|
|
|
|
|
|
|
return ret
|