Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use nosort in bash <4.4 #1683

Merged
merged 2 commits into from
May 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion etc/completion/completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 delta -o nosort
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why you moved -o nosort after delta. I'm not saying it's incorrect but I think positional arguments (delta) typically go last.

Copy link
Contributor Author

@martinml martinml May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, my bad. I reordered them so the difference between the two lines was clearer, but it looks like I didn't realize delta was positional. Fixing it now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

fi
Loading