From 9daa93094de07cd382d59affabd91cb1681d8375 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 13 Mar 2022 05:32:13 +0000 Subject: Accomodate more types of completion setups --- bash/completion.bash | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bash') diff --git a/bash/completion.bash b/bash/completion.bash index 50e8f35..764463e 100644 --- a/bash/completion.bash +++ b/bash/completion.bash @@ -1,7 +1,15 @@ -# source completions +# Completions.bash +# Source bash completion libraries -. /etc/bash_completion +POSSIBLE_COMPLETION_FILES=( + /etc/bash_completion # Debian + /etc/profile.d/bash_completion.sh # Alpine + # I'm sure there are many more +) -# for file in /etc/bash_completion.d/*; do -# [ -r "$file" ] && source "$file" -# done +for candidate in "${POSSIBLE_COMPLETION_FILES[@]}"; do + if [[ -r "$candidate" ]]; then + source "$candidate" + break # XXX: Do I want this? + fi +done -- cgit 1.4.1-21-gabe81