about summary refs log tree commit diff
path: root/Completion/User/_users
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User/_users')
-rw-r--r--Completion/User/_users7
1 files changed, 7 insertions, 0 deletions
diff --git a/Completion/User/_users b/Completion/User/_users
index fc1e87e52..b115cccdc 100644
--- a/Completion/User/_users
+++ b/Completion/User/_users
@@ -1,6 +1,13 @@
 #autoload
 
+# If a parameter `users' exists and it is an array, we first try to
+# complete only to its elements.
+
 local expl
 
 _description expl user
+
+[[ "${(t)users}" = *array* ]] &&
+    compadd "$expl[@]" "$@" - "$users[@]" && return 0
+
 compgen "$@" "$expl[@]" -u