dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
21.32k stars 358 forks source link

Only use `nosort` in bash <4.4 #1683

Closed martinml closed 1 month ago

martinml commented 1 month ago

Today I updated git-delta via brew and started seeing the following error message in all my new shells:

-bash: complete: nosort: invalid option name

Turns out the bash_completion.d script included in delta uses nosort, which doesn't exist until Bash 4.4, which I don't have (native macOS bash is currently 3.2.57 for me).

So I added a check for the version, ~blatantly stolen~ heavily inspired from what cobra does.