]>
Commit | Line | Data |
---|---|---|
41e5a92c SK |
1 | _chsh_module() |
2 | { | |
3 | local cur prev OPTS | |
4 | COMPREPLY=() | |
5 | cur="${COMP_WORDS[COMP_CWORD]}" | |
6 | prev="${COMP_WORDS[COMP_CWORD-1]}" | |
7 | case $prev in | |
8 | '-s'|'--shell') | |
9 | COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) ) | |
10 | return 0 | |
11 | ;; | |
12 | esac | |
13 | case $cur in | |
14 | -*) | |
15 | OPTS="-s --shell -l --list-shells -V --version -u --help" | |
16 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) | |
17 | return 0 | |
18 | ;; | |
19 | esac | |
20 | COMPREPLY=( $(compgen -u -- $cur) ) | |
21 | return 0 | |
22 | } | |
23 | complete -F _chsh_module chsh |