about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Unix/Command/_chown19
1 files changed, 19 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown
new file mode 100644
index 000000000..40f38d2f4
--- /dev/null
+++ b/Completion/Unix/Command/_chown
@@ -0,0 +1,19 @@
+#compdef chown chgrp
+
+local suf
+
+if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then
+  if [[ $service = chgrp ]] || compset -P '*[:.]'; then
+    _groups
+  else
+    if [[ $OSTYPE = (solaris*|hpux*) ]]; then
+      suf=':'
+    else
+      suf='.'
+    fi
+    compset -S '.*' && unset suf
+    _users -S "$suf" -q
+  fi
+else
+  _files
+fi