nutools/lib/bashrc.d/bash_completion.shared

34 lines
1.1 KiB
Bash
Raw Normal View History

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
##@before *
2013-09-30 06:40:51 +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
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*)
# le code suivant n'est compatible qu'avec debian wheezy (plus
2015-03-18 17:26:21 +04:00
# exactement, avec bash 4.1)
_file="@@dest@@/lib/ulib/bash41/bash_completion"
;;
esac
[ -f "$_file" ] && source "$_file"
unset _file
fi
2015-03-26 20:53:48 +04:00
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
2013-09-30 06:40:51 +04:00
fi