From 347fab44e07c07caad63d3a9f2a0137df9cc0615 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 19 Jul 1999 14:26:17 +0000 Subject: Initial revision --- Completion/User/_su | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Completion/User/_su (limited to 'Completion/User/_su') diff --git a/Completion/User/_su b/Completion/User/_su new file mode 100644 index 000000000..e5bf09d80 --- /dev/null +++ b/Completion/User/_su @@ -0,0 +1,22 @@ +#compdef su + +local shell comp name usr base + +[[ $words[2] != - ]] +(( base=$?+2 )) + +if [[ CURRENT -eq base ]]; then + compgen -u && return + usr=root +elif [[ CURRENT -ge base+1 ]]; then + usr=$words[base] +else + return +fi + +shell=${"$(egrep "^$usr:"