Add GNU chsh option completions.
This commit is contained in:
parent
329890a73b
commit
c6e9334cfa
2
CHANGES
2
CHANGES
@ -24,7 +24,7 @@ bash-completion (2.x)
|
|||||||
* Apply cardctl completion to pccardctl too.
|
* Apply cardctl completion to pccardctl too.
|
||||||
* Apply pine completion to alpine too.
|
* Apply pine completion to alpine too.
|
||||||
* Remove many unnecessary short option completions where long ones exist.
|
* Remove many unnecessary short option completions where long ones exist.
|
||||||
* Improve configure, cvs, gkrellm, lftp, mdadm, modprobe, mplayer,
|
* Improve chsh, configure, cvs, gkrellm, lftp, mdadm, modprobe, mplayer,
|
||||||
mysqladmin, rsync, screen, service, scp, ssh, update-alternatives,
|
mysqladmin, rsync, screen, service, scp, ssh, update-alternatives,
|
||||||
vncviewer, and general hostname completions.
|
vncviewer, and general hostname completions.
|
||||||
* Add abook and wtf completion, based on work by Raphaël Droz.
|
* Add abook and wtf completion, based on work by Raphaël Droz.
|
||||||
|
15
contrib/chsh
15
contrib/chsh
@ -8,8 +8,19 @@ _chsh()
|
|||||||
cur=`_get_cword`
|
cur=`_get_cword`
|
||||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
|
|
||||||
if [ "$prev" = "-s" ]; then
|
case "$prev" in
|
||||||
_shells
|
--list-shells|--help|-v|--version)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-s|--shell)
|
||||||
|
_shells
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ "$cur" == -* && "$( uname -s )" == @(Linux|GNU|GNU/*) ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '--shell --list-shells --help --version' \
|
||||||
|
-- "$cur" ) )
|
||||||
else
|
else
|
||||||
COMPREPLY=( $( compgen -u -- "$cur" ) )
|
COMPREPLY=( $( compgen -u -- "$cur" ) )
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user