47 lines
1.7 KiB
Bash
47 lines
1.7 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
|
|
if [ -f /etc/debian_version ]; then
|
|
case "$(</etc/debian_version)" in
|
|
6*|squeeze*)
|
|
# le code suivant n'est compatible qu'avec debian squeeze
|
|
if [ -z "$BASH_COMPLETION" -a "${BASH_VERSINFO[0]}" -ge 4 ]; then
|
|
source "@@dest@@/lib/ulib/bash_completion"
|
|
fi
|
|
if [ -n "$BASH_COMPLETION" ]; then
|
|
if [ -n "$BASH_COMPLETION_DIR" -a -f "$BASH_COMPLETION_DIR/ssh" ]; then
|
|
shopt -u hostcomplete
|
|
complete -F _ssh ussh cssh
|
|
fi
|
|
|
|
function _nutools_h() {
|
|
local cur prev
|
|
_get_comp_words_by_ref cur prev
|
|
if [ "$prev" == "-h" -o "$prev" == "-H" ]; then
|
|
_known_hosts_real "$cur"
|
|
fi
|
|
}
|
|
complete -F _nutools_h -o default ruinst runs rruns
|
|
|
|
function __pdev_branches() {
|
|
git for-each-ref --format='%(refname:short)' refs/heads |
|
|
grep -vF master |
|
|
grep -v '^release-' |
|
|
grep -v '^hotfix-'
|
|
}
|
|
function _pdev() {
|
|
local cur
|
|
_get_comp_words_by_ref cur
|
|
COMPREPLY=($(compgen -W "$(__pdev_branches)" "$cur"))
|
|
}
|
|
complete -F _pdev pdev
|
|
fi
|
|
;;
|
|
7*|wheezy*)
|
|
# le code suivant n'est compatible qu'avec debian wheezy
|
|
;;
|
|
esac
|
|
fi
|
|
fi
|