From 9b4c4ee7b642163dc4ceea3e95d601f527d79446 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 19 Jan 2023 17:48:21 -0600 Subject: [PATCH] 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. --- share/completions/fail2ban-client.fish | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/completions/fail2ban-client.fish b/share/completions/fail2ban-client.fish index 56e78e45e..7f19e3d25 100644 --- a/share/completions/fail2ban-client.fish +++ b/share/completions/fail2ban-client.fish @@ -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