about summary refs log tree commit diff
path: root/Completion/Linux/Command/_gpasswd
diff options
context:
space:
mode:
authorEric Cook <llua@gmx.com>2016-02-11 22:53:16 -0500
committerEric Cook <illua@users.sourceforge.net>2016-02-11 22:53:16 -0500
commit9cc6ebe7a2263e6697d497e95335369b06bec11b (patch)
tree3c35b78e6defa49cfcce347e171ffd0d6cb85867 /Completion/Linux/Command/_gpasswd
parent6d82ce161a760af4421c1153e78741bda95bf6b6 (diff)
downloadzsh-9cc6ebe7a2263e6697d497e95335369b06bec11b.tar.gz
zsh-9cc6ebe7a2263e6697d497e95335369b06bec11b.tar.xz
zsh-9cc6ebe7a2263e6697d497e95335369b06bec11b.zip
37913: add additional completers and _zpool improvement
Diffstat (limited to 'Completion/Linux/Command/_gpasswd')
-rw-r--r--Completion/Linux/Command/_gpasswd21
1 files changed, 21 insertions, 0 deletions
diff --git a/Completion/Linux/Command/_gpasswd b/Completion/Linux/Command/_gpasswd
new file mode 100644
index 000000000..9b4bedec6
--- /dev/null
+++ b/Completion/Linux/Command/_gpasswd
@@ -0,0 +1,21 @@
+#compdef gpasswd
+local curcontext=$curcontext state state_descr line
+typeset -A opt_args
+
+_arguments -C -w -s \
+  '(-a --add -d --delete)'{-a,--add}'[add user to group]: : _users' \
+  '(-d --delete -a --add)'{-d,--delete}'[remove user from group]: : _users' \
+  '(-h --help)'{-h,--help}'[display help]' \
+  '(-Q --root)'{-Q,--root}'[directory to chroot into]: : _files -/' \
+  '(-r --remove-password)'{-r,--remove-password}'[remove the group password]' \
+  '(-R --restrict)'{-R,--restrict}'[restrict access to GROUP to its members]' \
+  '(-M --members -A --administrators)'{-M,--members}'[set the list of members of GROUP]: :->users' \
+  '(-A --administrators -M --members)'{-A,--administrators}'[set the list of admins for GROUP]: :->users' \
+  '1: : _groups'
+
+if [[ $state == users ]]; then
+  local -a ignore
+  compset -P '*,'; compset -S ',*'
+  ignore=( ${(s:,:)IPREFIX} ${(s:,:)ISUFFIX} )
+  _users -F ignore -qS ,
+fi