2013-09-30 06:40:51 +04:00
|
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
2013-10-02 17:42:37 +04:00
|
|
|
##@before *
|
2013-09-30 06:40:51 +04:00
|
|
|
|
2014-04-04 15:10:10 +04:00
|
|
|
if [ -n "$UTOOLS_BASH_COMPLETION" ]; then
|
2015-03-26 20:47:12 +04:00
|
|
|
function __bash_completion_enabled() { return 1; }
|
|
|
|
function __bash_completion_module_enabled() { return 1; }
|
|
|
|
if [ -f /etc/debian_version ]; then
|
2014-04-04 15:10:10 +04:00
|
|
|
case "$(</etc/debian_version)" in
|
|
|
|
6*|squeeze*)
|
2015-03-18 16:55:12 +04:00
|
|
|
# le code suivant n'est compatible qu'avec debian squeeze (plus
|
|
|
|
# exactement, avec bash 4.0)
|
2015-03-23 06:24:22 +04:00
|
|
|
_file="@@dest@@/lib/ulib/bash40/bash_completion"
|
2014-04-04 15:10:10 +04:00
|
|
|
;;
|
2016-06-02 17:24:46 +04:00
|
|
|
7*|wheezy*|8*|jessie*)
|
|
|
|
# le code suivant n'est compatible qu'avec debian wheezy et
|
|
|
|
# supérieur (plus exactement, avec bash 4.1)
|
2015-03-23 06:24:22 +04:00
|
|
|
_file="@@dest@@/lib/ulib/bash41/bash_completion"
|
2014-04-04 15:10:10 +04:00
|
|
|
;;
|
|
|
|
esac
|
2015-03-23 06:24:22 +04:00
|
|
|
[ -f "$_file" ] && source "$_file"
|
|
|
|
unset _file
|
2014-04-04 15:10:10 +04:00
|
|
|
fi
|
2015-03-26 20:53:48 +04:00
|
|
|
if __bash_completion_enabled; then
|
2015-03-23 05:08:27 +04:00
|
|
|
for i in "@@dest@@/lib/completion.d/"*; do
|
|
|
|
[ -f "$i" ] || continue
|
|
|
|
source "$i"
|
|
|
|
done
|
|
|
|
for i in "$HOME/etc/completion.d/"*; do
|
2015-03-18 16:55:12 +04:00
|
|
|
[ -f "$i" ] || continue
|
|
|
|
source "$i"
|
|
|
|
done
|
|
|
|
fi
|
2013-09-30 06:40:51 +04:00
|
|
|
fi
|