2000-04-01 22:43:43 +02:00
|
|
|
#compdef -tilde-
|
1999-04-15 20:05:38 +02:00
|
|
|
|
|
|
|
# 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
|
2000-05-31 11:38:25 +02:00
|
|
|
# `compadd -qS/ -a friends' or something like that.
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2000-05-16 13:24:55 +02:00
|
|
|
[[ -n "$compstate[quote]" ]] && return 1
|
|
|
|
|
2000-04-01 22:43:43 +02:00
|
|
|
local expl suf dirs list lines revlines i ret disp nm="$compstate[nmatches]"
|
|
|
|
|
|
|
|
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
|
2000-04-25 13:00:06 +02:00
|
|
|
|
2000-04-01 22:43:43 +02:00
|
|
|
_requested named-directories expl 'named directory' \
|
2000-05-31 11:38:25 +02:00
|
|
|
compadd "$suf[@]" "$@" -k nameddirs
|
2000-04-01 22:43:43 +02:00
|
|
|
|
2001-03-27 14:22:53 +02:00
|
|
|
_requested directory-stack && _popd "$suf[@]" && ret=0
|
|
|
|
|
2000-04-01 22:43:43 +02:00
|
|
|
(( ret )) || return 0
|
|
|
|
done
|