summaryrefslogtreecommitdiff
path: root/completions/gpasswd
diff options
context:
space:
mode:
Diffstat (limited to 'completions/gpasswd')
-rw-r--r--completions/gpasswd31
1 files changed, 31 insertions, 0 deletions
diff --git a/completions/gpasswd b/completions/gpasswd
new file mode 100644
index 00000000..6ac932e3
--- /dev/null
+++ b/completions/gpasswd
@@ -0,0 +1,31 @@
+# gpasswd(1) completion
+
+_gpasswd()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -a|--add|-d|--delete|-A|--administrators|-M|--members)
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ # TODO: only -A and -M can be combined
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -g -- "$cur" ) )
+} &&
+complete -F _gpasswd gpasswd
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh