about summary refs log tree commit diff
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
commitbe33587b5cdc55232ed45e24093cc8e6667d1c31 (patch)
tree75fbad8569bd6330a4dbffa7d2d4ceb50853b3e8
parent63324a98b14c0aca0ab2829019478143dea08c58 (diff)
downloadzsh-be33587b5cdc55232ed45e24093cc8e6667d1c31.tar.gz
zsh-be33587b5cdc55232ed45e24093cc8e6667d1c31.tar.xz
zsh-be33587b5cdc55232ed45e24093cc8e6667d1c31.zip
Initial revision
-rw-r--r--Completion/User/_user_at_host15
1 files changed, 15 insertions, 0 deletions
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] ]]