feat: Ajout automatique de la compltetion pour les aliases si _complete_alias est disponible

This commit is contained in:
Xavier Logerais 2024-06-28 08:32:11 +00:00
parent cb323ec6c0
commit ce15f00b6f

3
bashrc
View File

@ -28,6 +28,9 @@ if [ -f "$HOME"/.bash_aliases ]; then source "$HOME"/.bash_aliases; fi
if [ -f "$HOME"/.bash/aliases ]; then source "$HOME"/.bash/aliases; fi if [ -f "$HOME"/.bash/aliases ]; then source "$HOME"/.bash/aliases; fi
if [ -d "$HOME"/.bash/aliases ]; then for file in "$HOME"/.bash/aliases/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/aliases ]; then for file in "$HOME"/.bash/aliases/*; do source "$file"; done; fi
if [ -d "$HOME"/.bash/aliases.d ]; then for file in "$HOME"/.bash/aliases.d/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/aliases.d ]; then for file in "$HOME"/.bash/aliases.d/*; do source "$file"; done; fi
if (command -v _complete_alias &>/dev/null); then
for alias in $(alias -p | awk '{print $2}' | awk -F= '{print $1}'); do complete -o default -F _complete_alias "$alias"; done
fi
# Source bash completion definitions # Source bash completion definitions
for file in /etc/bash*completion /etc/profile.d/bash*completion*; do source "$file"; done for file in /etc/bash*completion /etc/profile.d/bash*completion*; do source "$file"; done