diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
commit | b09f4483416c54c1782824633dfabaf2ec0265b6 (patch) | |
tree | 304bc82642862525ae680c7fbaa249663b10ad57 /Completion/Unix/Command/_su | |
parent | 12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff) | |
parent | 6e55c920503071e917619b8cb1a188cd35d772db (diff) | |
download | zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip |
New upstream version 5.8.1.2-test
Diffstat (limited to 'Completion/Unix/Command/_su')
-rw-r--r-- | Completion/Unix/Command/_su | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su index 032f867f4..1af751a17 100644 --- a/Completion/Unix/Command/_su +++ b/Completion/Unix/Command/_su @@ -35,7 +35,7 @@ case $OSTYPE in ;| *bsd*|dragonfly*) args+=( - '-c+[use settings from specified login class]:class' + '-c+[use settings from specified login class]:class:_login_classes' ) ;| freebsd*) args+=( '-s[set the MAC label]' ) ;; @@ -63,6 +63,12 @@ if (( $words[(i)-] < CURRENT )); then norm=2 fi +# This is set so that _command_names will understand that we're completing for +# a privileged command, but _call_program won't actually prepend anything to +# commands if gain-privileges is enabled (which would be undesirable here since +# su always prompts for a password). We delay setting it until this point so it +# doesn't cause issues for the check above +local -a _comp_priv_prefix=( '' ) _arguments $args ${(e)first} "*:shell arguments:= ->rest" && return usr=${${(Q)line[norm]}/--/root} |