diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-13 16:43:15 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-09-13 16:43:15 +1200 |
commit | f68239fba2645b82e5e7d99d5c740f4a8d02535d (patch) | |
tree | 616888b0dd662afdfdfe2ed404eef364048db118 /bash | |
parent | Try out Readline history-preserve-point (diff) | |
download | dotfiles-f68239fba2645b82e5e7d99d5c740f4a8d02535d.tar.gz dotfiles-f68239fba2645b82e5e7d99d5c740f4a8d02535d.zip |
Version check for bashdefault in Git completion
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bash_completion.d/git.bash | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 5f4290b8..bde515ee 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -222,5 +222,10 @@ _git() { esac } -# Defaulting to directory/file completion is important in Git's case -complete -F _git -o bashdefault -o default git +# Defaulting to directory/file completion is important in Git's case; +# bashdefault requires Bash >=3.0 +if ((BASH_VERSINFO[0] >= 3)) ; then + complete -F _git -o bashdefault -o default git +else + complete -F _git -o default git +fi |