summaryrefslogtreecommitdiff
path: root/completions/chsh
diff options
context:
space:
mode:
Diffstat (limited to 'completions/chsh')
-rw-r--r--completions/chsh23
1 files changed, 7 insertions, 16 deletions
diff --git a/completions/chsh b/completions/chsh
index 1af3630f..f65291a1 100644
--- a/completions/chsh
+++ b/completions/chsh
@@ -1,11 +1,9 @@
-# chsh(1) completion
+# chsh(1) completion -*- shell-script -*-
_chsh()
{
- local cur prev
-
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
+ local cur prev words cword
+ _init_completion || return
case $prev in
--list-shells|--help|-v|--version)
@@ -17,21 +15,14 @@ _chsh()
;;
esac
- if [[ "$cur" == -* && "$( uname -s )" == @(Linux|GNU|GNU/*) ]]; then
- COMPREPLY=( $( compgen -W '--shell --list-shells --help --version' \
- -- "$cur" ) )
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
else
- COMPREPLY=( $( compgen -u -- "$cur" ) )
+ _allowed_users
fi
return 0
-}
+} &&
complete -F _chsh chsh
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
# ex: ts=4 sw=4 et filetype=sh