Don't use sort for fail2ban-client completions

As pointed out by faho, the completions will be deduplicated by the completion
mechanics. We don't use this list directly except to pass it up the chain to the
shell, so there's no benefit to shelling out to eagerly deduplicate the list.

Plus, as of 3.6.0, even manual `complete -C"..."` invocations now deduplicate
results the same as if completions were triggered.
This commit is contained in:
Mahmoud Al-Qudsi 2023-01-19 17:48:21 -06:00
parent 031a6a09a4
commit 9b4c4ee7b6

View File

@ -1,9 +1,11 @@
function __fail2ban_jails
path basename {,/usr/local}/etc/fail2ban/filter.d/*.{conf,local} | path change-extension "" | sort -u
# No need to deduplicate because fish will take care of that for us
path basename {,/usr/local}/etc/fail2ban/filter.d/*.{conf,local} | path change-extension ""
end
function __fail2ban_actions
path basename {,/usr/local}/etc/fail2ban/action.d/*.{conf,local} | path change-extension "" | sort -u
# No need to deduplicate because fish will take care of that for us
path basename {,/usr/local}/etc/fail2ban/action.d/*.{conf,local} | path change-extension ""
end
# basic options