summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2009-12-26 12:31:26 +0200
committerVille Skyttä <ville.skytta@iki.fi>2009-12-26 12:31:26 +0200
commitc6e9334cfa9af956c2711f5b8930802d52efacc4 (patch)
treec54e6055f542d3600b805aad1c3d65a904f7065a /contrib
parent329890a73b14b4fc32e9fdd3e8148c9eebbe2ffc (diff)
downloadbash-completion-c6e9334cfa9af956c2711f5b8930802d52efacc4.tar.gz
Add GNU chsh option completions.
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