about summary refs log tree commit diff
path: root/Completion/User/_user@host
blob: 6006ef63bac473e99aba3cce500dce642f6f4dcc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#autoload

local expl nm="$compstate[nmatches]"

if [[ -prefix 1 *@ ]]; then
  local user=${PREFIX/@}
  compset -P 1 '*@'
  _description expl "hostnames for $user"
  _combination accounts_users_hosts users="$user" hosts "$expl[@]" "$@"
else
  _description expl "usernames"
  _combination accounts_users_hosts users -S@ -q "$expl[@]" "$@"
fi

[[ nm -ne compstate[nmatches] ]]