1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-05 07:06:17 +02:00

Fix merge

This commit is contained in:
Peter Stephenson 2014-08-23 20:54:43 +01:00
commit 510a11834a
4 changed files with 48 additions and 1 deletions

View File

@ -2,6 +2,12 @@
* unposted: Etc/.gitignore: ignore generated FAQ*.html files.
2014-08-23 Barton E. Schaefer <schaefer@zsh.org>
* 33046: Completion/Unix/Command/.distfiles,
Completion/Unix/Command/_chsh, Completion/Unix/Type/_users: new
completion for "chsh"
2014-08-22 Barton E. Schaefer <schaefer@zsh.org>
* 33042: NEWS, Src/jobs.c: $? and $pipestatus report 128+signal

View File

@ -29,6 +29,7 @@ _cdrecord
_chkconfig
_chmod
_chown
_chsh
_clay
_comm
_compress

View File

@ -0,0 +1,40 @@
#compdef chsh chpass
case $OSTYPE in
(darwin*|*bsd*)
_arguments : \
'-s[Specify user login shell]:shell:(${(Z+Cn+)"$(</etc/shells)"})' \
"-l[Specify location of user]:node:" \
"-u[Specify authentication name]:auth user:" \
"1:user name:_users"
;;
(linux-gnu)
if { =chsh -v } >&/dev/null
then
local -a opts shells
shells=( $(=chsh -l) )
_arguments : \
"(-)-s[Specify your login shell]:shell:($shells)" \
"(-)--shell[Specify your login shell]:shell:($shells)" \
"(-)-l[Print shells in /etc/shells]" \
"(-)--list-shells[Print shells in /etc/shells]" \
"(-)-u[Print a usage message and exit]" \
"(-)--help[Print a usage message and exit]" \
"(-)-v[Print version information and exit]" \
"(-)--version[Print version information and exit]" \
"1:user name:_users"
return
fi
# else fall through
;&
(*)
local s=''
# Use $s to cause all options to be treated as mutually exclusive
[[ $words[CURRENT-1] = -* ]] && s="(-)$words[CURRENT-1]"
# This fiddling with $s is a hack to cause "_arguments : --" to use
# the /etc/shells listing for -s or --shell even when the description
# of that option has been pulled from the GNU --help output.
[[ $words[CURRENT-1] = (-s|--shell) ]] &&
s="$s"'[ ]:shell:(${(Z+Cn+)"$(</etc/shells)"})'
_arguments : $s "1:user name:_users" --
;;
esac

View File

@ -1,4 +1,4 @@
#compdef passwd groups userdel chage chfn chsh
#compdef passwd groups userdel chage chfn
local expl users