about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-29 23:00:20 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-29 23:00:20 +0000
commitc6257a5a71eddd09e7d33fa160608f944d3e4116 (patch)
tree0fd82b6dbf3d218357089b16d4115f1dbaae71f7 /Completion
parentf5c25fe270ba371b0ab5766b430640df70de7c56 (diff)
downloadzsh-c6257a5a71eddd09e7d33fa160608f944d3e4116.tar.gz
zsh-c6257a5a71eddd09e7d33fa160608f944d3e4116.tar.xz
zsh-c6257a5a71eddd09e7d33fa160608f944d3e4116.zip
zsh-workers/8101
Diffstat (limited to 'Completion')
-rw-r--r--Completion/User/_my_accounts2
-rw-r--r--Completion/User/_other_accounts2
-rw-r--r--Completion/User/_user_at_host15
3 files changed, 17 insertions, 2 deletions
diff --git a/Completion/User/_my_accounts b/Completion/User/_my_accounts
index 72aec5d2f..34d6269d4 100644
--- a/Completion/User/_my_accounts
+++ b/Completion/User/_my_accounts
@@ -10,4 +10,4 @@ else
   accounts_users_hosts=( $my_accounts )
 fi
 
-_user@host "$@"
+_user_at_host "$@"
diff --git a/Completion/User/_other_accounts b/Completion/User/_other_accounts
index f5165dc6f..9e3545e98 100644
--- a/Completion/User/_other_accounts
+++ b/Completion/User/_other_accounts
@@ -10,4 +10,4 @@ else
   accounts_users_hosts=( $other_accounts )
 fi
 
-_user@host "$@"
+_user_at_host "$@"
diff --git a/Completion/User/_user_at_host b/Completion/User/_user_at_host
new file mode 100644
index 000000000..6006ef63b
--- /dev/null
+++ b/Completion/User/_user_at_host
@@ -0,0 +1,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] ]]