From b3208dd0751116ddfece55a77b8002feeaf14312 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Wed, 2 Oct 2013 17:42:37 +0400 Subject: [PATCH] =?UTF-8?q?compatibilit=C3=A9=20avec=20anciennes=20version?= =?UTF-8?q?s=20de=20bash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bashrc.d/bash_completion.nutools | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/bashrc.d/bash_completion.nutools b/lib/bashrc.d/bash_completion.nutools index 5d50c25..837283f 100644 --- a/lib/bashrc.d/bash_completion.nutools +++ b/lib/bashrc.d/bash_completion.nutools @@ -1,6 +1,15 @@ # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 +##@before * -[ -n "$BASH_COMPLETION" ] || source "@@dest@@/ulib/bash_completion" +if [ -z "$BASH_COMPLETION" ]; then + [ "${BASH_VERSINFO[0]}" -ge 3 -a "${BASH_VERSINFO[1]}" -ge 2 ] && __bash32=1 || __bash32= + [ "${BASH_VERSINFO[0]}" -ge 4 ] && __bash40=1 || __bash40= + if [ -n "$__bash32" -o -n "$__bash40" ]; then + source "@@dest@@/ulib/bash_completion" + fi + unset __bash32 + unset __bash40 +fi if [ -n "$BASH_COMPLETION" ]; then if [ -n "$BASH_COMPLETION_DIR" -a -f "$BASH_COMPLETION_DIR/ssh" ]; then shopt -u hostcomplete