2013-03-23 11:49:52 -05:00
|
|
|
_chsh_module()
|
|
|
|
{
|
|
|
|
local cur prev OPTS
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
case $prev in
|
|
|
|
'-s'|'--shell')
|
2014-11-15 14:36:04 -06:00
|
|
|
COMPREPLY=( $(compgen -W "$($1 -l)" -- $cur) )
|
2013-03-23 11:49:52 -05:00
|
|
|
return 0
|
|
|
|
;;
|
2013-04-07 03:12:04 -05:00
|
|
|
'-u'|'--help'|'-v'|'--version')
|
|
|
|
return 0
|
|
|
|
;;
|
2013-03-23 11:49:52 -05:00
|
|
|
esac
|
|
|
|
case $cur in
|
|
|
|
-*)
|
2013-04-07 03:12:08 -05:00
|
|
|
OPTS="--shell --list-shells --version --help"
|
2013-03-23 11:49:52 -05:00
|
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
COMPREPLY=( $(compgen -u -- $cur) )
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _chsh_module chsh
|