]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - bash-completion/su
Merge branch 'highsierra' of https://github.com/pali/util-linux
[thirdparty/util-linux.git] / bash-completion / su
index c72f6a10b72897e61f78dd6d8be749cbb2ea5af8..913e445230a4a6b620c8fac1ccdafd085e01524f 100644 (file)
@@ -17,27 +17,31 @@ _su_module()
                        COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) )
                        return 0
                        ;;
+               '-h'|'--help'|'-V'|'--version')
+                       return 0
+                       ;;
        esac
        case $cur in
                -*)
-                       OPTS="  -
-                               -u --user
-                               -m -p --preserve-environment
-                               -g --group
-                               -G --supp-group
-                               -l --login
-                               -c --command
+                       OPTS="  --user
+                               --preserve-environment
+                               --whitelist-environment
+                               --group
+                               --supp-group
+                               --login
+                               --command
                                --session-command
-                               -f --fast
-                               -s --shell
-                               -h --help
-                               -V --version"
+                               --fast
+                               --shell
+                               --help
+                               --version"
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
-       COMPREPLY=( $(compgen -f -- $cur) )
+       COMPREPLY=( $(compgen -u -- $cur) )
        return 0
 }
 complete -F _su_module su