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 pine completion to alpine too.
|
||||
* 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,
|
||||
vncviewer, and general hostname completions.
|
||||
* 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`
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
if [ "$prev" = "-s" ]; then
|
||||
_shells
|
||||
case "$prev" in
|
||||
--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
|
||||
COMPREPLY=( $( compgen -u -- "$cur" ) )
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user