diff options
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/User/_su | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Completion/User/_su b/Completion/User/_su index e5bf09d80..daf301555 100644 --- a/Completion/User/_su +++ b/Completion/User/_su @@ -6,7 +6,7 @@ local shell comp name usr base (( base=$?+2 )) if [[ CURRENT -eq base ]]; then - compgen -u && return + _users && return usr=root elif [[ CURRENT -ge base+1 ]]; then usr=$words[base] @@ -14,9 +14,9 @@ else return fi -shell=${"$(egrep "^$usr:" </etc/passwd)"##*:} +shell="${${(M@)${(@f)$(</etc/passwd)}:#$usr*}##*:}" compset -n $base for name in $shell $shell:t -default-; do comp="$_comps[$name]" - [[ ! -z "$comp" ]] && "$comp" && return + [[ -n "$comp" ]] && "$comp" && return done |