about summary refs log tree commit diff
path: root/Completion/User/_user_at_host
blob: 1f93daacc8863eec163f1c7ca09b062dedfff8f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#autoload

if [[ -prefix 1 *@ ]]; then
  local user=${PREFIX/@}

  compset -P 1 '*@'

  _wanted -C user-at hosts expl "hostnames for $user" &&
      _combination accounts_users_hosts users="$user" hosts "$expl[@]" "$@"
else
  _wanted users expl "usernames" &&
      _combination accounts_users_hosts users -S@ -q "$expl[@]" "$@"
fi