summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_su
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_su')
-rw-r--r--Completion/Unix/Command/_su8
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}