diff options
author | Sami Kerola | 2013-03-23 17:49:52 +0100 |
---|---|---|
committer | Sami Kerola | 2013-04-01 18:16:53 +0200 |
commit | 41e5a92cf1cd8950df8b02fdd2ea8be571dbab02 (patch) | |
tree | b63263b7d4d5b026f36557eb4bdfdce2dd6ca18e /shell-completion/chsh | |
parent | bash-completion: fdisks (diff) | |
download | kernel-qcow2-util-linux-41e5a92cf1cd8950df8b02fdd2ea8be571dbab02.tar.gz kernel-qcow2-util-linux-41e5a92cf1cd8950df8b02fdd2ea8be571dbab02.tar.xz kernel-qcow2-util-linux-41e5a92cf1cd8950df8b02fdd2ea8be571dbab02.zip |
bash-completion: login-utils
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'shell-completion/chsh')
-rw-r--r-- | shell-completion/chsh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/shell-completion/chsh b/shell-completion/chsh new file mode 100644 index 000000000..c0a194cf3 --- /dev/null +++ b/shell-completion/chsh @@ -0,0 +1,23 @@ +_chsh_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-s'|'--shell') + COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) ) + return 0 + ;; + esac + case $cur in + -*) + OPTS="-s --shell -l --list-shells -V --version -u --help" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + COMPREPLY=( $(compgen -u -- $cur) ) + return 0 +} +complete -F _chsh_module chsh |