about summary refs log tree commit diff
path: root/Completion/Unix/Type
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Type')
-rw-r--r--Completion/Unix/Type/_directories3
-rw-r--r--Completion/Unix/Type/_groups19
-rw-r--r--Completion/Unix/Type/_users2
3 files changed, 23 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_directories b/Completion/Unix/Type/_directories
new file mode 100644
index 000000000..9a1a9c1f3
--- /dev/null
+++ b/Completion/Unix/Type/_directories
@@ -0,0 +1,3 @@
+#compdef rmdir df du dircmp dirs
+
+_files -/ "$@"
diff --git a/Completion/Unix/Type/_groups b/Completion/Unix/Type/_groups
new file mode 100644
index 000000000..bbb80868b
--- /dev/null
+++ b/Completion/Unix/Type/_groups
@@ -0,0 +1,19 @@
+#compdef newgrp groupdel
+
+local expl groups tmp
+
+_tags groups || return 1
+
+if ! zstyle -a ":completion:${curcontext}:" groups groups; then
+  (( $+_cache_groups )) ||
+      if (( ${+commands[ypcat]} )) &&
+	  tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then
+        : ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP
+      else
+        : ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}}
+      fi
+
+  groups=( "$_cache_groups[@]" )
+fi
+
+_wanted groups expl group compadd "$@" -a groups
diff --git a/Completion/Unix/Type/_users b/Completion/Unix/Type/_users
index 573d8fdb1..d04a16afe 100644
--- a/Completion/Unix/Type/_users
+++ b/Completion/Unix/Type/_users
@@ -1,4 +1,4 @@
-#compdef passwd groups
+#compdef passwd groups userdel
 
 local expl users