bug
This commit is contained in:
parent
e8d683b91a
commit
163df888d8
|
@ -17,7 +17,7 @@ if [ -n "$UTOOLS_BASH_COMPLETION" ]; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
if [ -n "$BASH_COMPLETION" ]; then
|
if [ -n "$BASH_COMPLETION" ]; then
|
||||||
for i in "$@@dest@@/lib/bash_completion.d/"*; do
|
for i in "@@dest@@/lib/bash_completion.d/"*; do
|
||||||
[ -f "$i" ] || continue
|
[ -f "$i" ] || continue
|
||||||
source "$i"
|
source "$i"
|
||||||
done
|
done
|
||||||
|
|
|
@ -8,17 +8,18 @@
|
||||||
uprovide bash_completion
|
uprovide bash_completion
|
||||||
|
|
||||||
function __is_bash_completion_enabled() {
|
function __is_bash_completion_enabled() {
|
||||||
[ -n "$BASH_COMPLETION" ] && return 0
|
[ -n "$__NUTOOLS_BASH_COMPLETION" ] && return 0
|
||||||
grep -qE '^[ \t]*(\.|source)[ \t]*/usr/share/bash-completion/bash_completion' /etc/bash.bashrc && return 0
|
grep -qE '^[ \t]*(\.|source)[ \t]*/usr/share/bash-completion/bash_completion' /etc/bash.bashrc && return 0
|
||||||
grep -qE '^[ \t]*(\.|source)[ \t]*/usr/share/bash-completion/bash_completion' ~/.bashrc && return 0
|
grep -qE '^[ \t]*(\.|source)[ \t]*/usr/share/bash-completion/bash_completion' ~/.bashrc && return 0
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
function __is_bash_completion_module_enabled() {
|
function __is_bash_completion_module_enabled() {
|
||||||
[ -f "/usr/share/bash-completion/completions/$1" ] && return 0
|
[ -f "/usr/share/bash-completion/completions/$1" ] && return 0
|
||||||
[ -n "$BASH_COMPLETION_COMPAT_DIR" -a -f "$BASH_COMPLETION_COMPAT_DIR/$1" ]
|
[ -n "$BASH_COMPLETION_COMPAT_DIR" -a -f "$BASH_COMPLETION_COMPAT_DIR/$1" ] && return 0
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! __is_bash_completion_enabled; then
|
if ! __is_bash_completion_enabled; then
|
||||||
export BASH_COMPLETION=1
|
export __NUTOOLS_BASH_COMPLETION=1
|
||||||
:
|
|
||||||
fi
|
fi
|
||||||
|
[ -n "$BASH_COMPLETION" ] || export BASH_COMPLETION=1
|
||||||
|
|
Loading…
Reference in New Issue