34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
##@before *
|
|
|
|
if [ -n "$UTOOLS_BASH_COMPLETION" ]; then
|
|
function __bash_completion_enabled() { return 1; }
|
|
function __bash_completion_module_enabled() { return 1; }
|
|
if [ -f /etc/debian_version ]; then
|
|
case "$(</etc/debian_version)" in
|
|
6*|squeeze*)
|
|
# le code suivant n'est compatible qu'avec debian squeeze (plus
|
|
# exactement, avec bash 4.0)
|
|
_file="@@dest@@/lib/ulib/bash40/bash_completion"
|
|
;;
|
|
7*|wheezy*|8*|jessie*|9*|stretch*)
|
|
# le code suivant n'est compatible qu'avec debian wheezy et
|
|
# supérieur (plus exactement, avec bash 4.1)
|
|
_file="@@dest@@/lib/ulib/bash41/bash_completion"
|
|
;;
|
|
esac
|
|
[ -f "$_file" ] && source "$_file"
|
|
unset _file
|
|
fi
|
|
if __bash_completion_enabled; then
|
|
for i in "@@dest@@/lib/completion.d/"*; do
|
|
[ -f "$i" ] || continue
|
|
source "$i"
|
|
done
|
|
for i in "$HOME/etc/completion.d/"*; do
|
|
[ -f "$i" ] || continue
|
|
source "$i"
|
|
done
|
|
fi
|
|
fi
|