]>
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') | |
396a6d7d | 9 | COMPREPLY=( $(compgen -W "$($1 -l)" -- $cur) ) |
41e5a92c SK |
10 | return 0 |
11 | ;; | |
d4f9b8d7 VS |
12 | '-u'|'--help'|'-v'|'--version') |
13 | return 0 | |
14 | ;; | |
41e5a92c SK |
15 | esac |
16 | case $cur in | |
17 | -*) | |
0d5b9b8a | 18 | OPTS="--shell --list-shells --version --help" |
41e5a92c SK |
19 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
20 | return 0 | |
21 | ;; | |
22 | esac | |
23 | COMPREPLY=( $(compgen -u -- $cur) ) | |
24 | return 0 | |
25 | } | |
26 | complete -F _chsh_module chsh |