diff options
author | martinml <217925+martinml@users.noreply.github.com> | 2024-05-10 19:05:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-10 13:05:29 -0400 |
commit | 0f8a2f0786d56e9395b7e7f244f356bfdab562e8 (patch) | |
tree | f7e7c20e10c59d8c078cd4beb7c3d15db12045bf | |
parent | 97839c61c873523ea86c5f1206856a322a1037a3 (diff) |
Only use `nosort` in bash <4.4 (#1683)
* Only use `nosort` in bash <4.4
* Fix bad parameter order
-rw-r--r-- | etc/completion/completion.bash | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/completion/completion.bash b/etc/completion/completion.bash index 5c7de994..124f73c3 100644 --- a/etc/completion/completion.bash +++ b/etc/completion/completion.bash @@ -375,4 +375,9 @@ _delta() { esac } -complete -F _delta -o nosort -o bashdefault -o default delta +# nosort isn't supported for bash less than < 4.4 +if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then + complete -F _delta -o bashdefault -o default delta +else + complete -F _delta -o bashdefault -o default -o nosort delta +fi |