about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-27 13:39:00 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-27 13:39:00 +0000
commit090dee6d074ff4d3ec28a8772baebd0406322ec1 (patch)
treef42475b61c60d5e96f25fda781ece1f06ac07e1d /Completion
parentb6643f59766afbb6287e9b4a44f5171a9868fe0b (diff)
downloadzsh-090dee6d074ff4d3ec28a8772baebd0406322ec1.tar.gz
zsh-090dee6d074ff4d3ec28a8772baebd0406322ec1.tar.xz
zsh-090dee6d074ff4d3ec28a8772baebd0406322ec1.zip
zsh-workers/8065
Diffstat (limited to 'Completion')
-rw-r--r--Completion/User/_my_accounts2
-rw-r--r--Completion/User/_other_accounts2
-rw-r--r--Completion/User/_user@host15
3 files changed, 17 insertions, 2 deletions
diff --git a/Completion/User/_my_accounts b/Completion/User/_my_accounts
index 91ab88cc1..2d3261d2a 100644
--- a/Completion/User/_my_accounts
+++ b/Completion/User/_my_accounts
@@ -11,4 +11,4 @@ else
   accounts_users_hosts=( $my_accounts )
 fi
 
-_user@host
+_user@host "$@"
diff --git a/Completion/User/_other_accounts b/Completion/User/_other_accounts
index e1d357fc0..572db38c7 100644
--- a/Completion/User/_other_accounts
+++ b/Completion/User/_other_accounts
@@ -11,4 +11,4 @@ else
   accounts_users_hosts=( $other_accounts )
 fi
 
-_user@host
+_user@host "$@"
diff --git a/Completion/User/_user@host b/Completion/User/_user@host
new file mode 100644
index 000000000..6006ef63b
--- /dev/null
+++ b/Completion/User/_user@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] ]]