summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/chsh15
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/chsh b/contrib/chsh
index 46ee029f..23e1500e 100644
--- a/contrib/chsh
+++ b/contrib/chsh
@@ -8,8 +8,19 @@ _chsh()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
- if [ "$prev" = "-s" ]; then
- _shells
+ case "$prev" in
+ --list-shells|--help|-v|--version)
+ return 0
+ ;;
+ -s|--shell)
+ _shells
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* && "$( uname -s )" == @(Linux|GNU|GNU/*) ]]; then
+ COMPREPLY=( $( compgen -W '--shell --list-shells --help --version' \
+ -- "$cur" ) )
else
COMPREPLY=( $( compgen -u -- "$cur" ) )
fi