summaryrefslogtreecommitdiff
path: root/completions/groupadd
diff options
context:
space:
mode:
Diffstat (limited to 'completions/groupadd')
-rw-r--r--completions/groupadd27
1 files changed, 27 insertions, 0 deletions
diff --git a/completions/groupadd b/completions/groupadd
new file mode 100644
index 00000000..db5ff872
--- /dev/null
+++ b/completions/groupadd
@@ -0,0 +1,27 @@
+# groupadd(8) completion -*- shell-script -*-
+
+_groupadd()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ # TODO: if -o/--non-unique is given, could complete on existing gids
+ # with -g/--gid
+
+ case $prev in
+ -g|--gid|-K|--key|-p|--password)
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+} &&
+complete -F _groupadd groupadd
+
+# ex: ts=4 sw=4 et filetype=sh