Merge branch 'master' of vcs.univ.run:modules/nutools

This commit is contained in:
Jephté Clain 2013-10-14 11:02:27 +04:00
commit 12adf99dbf
1 changed files with 43 additions and 21 deletions

View File

@ -34,29 +34,51 @@ function pcd() {
dir="$("@@dest@@/uproject" "get$prop")" || return 1 dir="$("@@dest@@/uproject" "get$prop")" || return 1
[ -n "$dir" ] && cd "$dir" [ -n "$dir" ] && cd "$dir"
} }
function utools() { function nutools() {
case "${1:-cycle}" in if [ -n "$1" ]; then
0|d|dis|disable) UTOOLS=;; case "$1" in
1|e|ena|enable) UTOOLS=1;; 0|d|dis|disable) UTOOLS=;;
f|full) UTOOLS=f;; 1|e|ena|enable) UTOOLS=1;;
cycle) f|full) UTOOLS=f;;
case "$UTOOLS" in cycle)
"") UTOOLS=1;; case "$UTOOLS" in
1) UTOOLS=f;; 1) UTOOLS=f;;
f) UTOOLS=;; f) UTOOLS=;;
*) UTOOLS=1;;
esac
;;
n|np|nopush) NOPUSH=1;;
push) NOPUSH=;;
p|cyclep)
case "$NOPUSH" in
"") NOPUSH=1;;
*) NOPUSH=;;
esac
;;
esac esac
;; echo "UTOOLS=$UTOOLS; NOPUSH=$NOPUSH" 1>&2
n|np|nopush) NOPUSH=1;; else
push) NOPUSH=;; local PS3 prompt nopush
p|cyclep) echo "=== Type de prompt ===" 1>&2
case "$NOPUSH" in PS3="Veuillez choisir le type de prompt: "
"") NOPUSH=1;; select prompt in Aucun$([ -z "$UTOOLS" ] && echo "*") Minimum$([ "$UTOOLS" == 1 ] && echo "*") Complet$([ "$UTOOLS" == f ] && echo "*"); do
*) NOPUSH=;; case "$prompt" in
esac Aucun*) UTOOLS=; break;;
;; Minimum*) UTOOLS=1; break;;
esac Complet*) UTOOLS=f; break;;
echo "UTOOLS=$UTOOLS; NOPUSH=$NOPUSH" 1>&2 esac
done
echo "=== git push automatique ===" 1>&2
PS3="Veuillez choisir le type de push: "
select nopush in "Après git commit, faire git push$([ -z "$NOPUSH" ] && echo "*")" "Pas de git push auto$([ -n "$NOPUSH" ] && echo "*")"; do
case "$nopush" in
"Après git commit, faire git push"*) NOPUSH=; break;;
"Pas de git push auto"*) NOPUSH=1; break;;
esac
done
fi
} }
function utools() { nutools "$@"; }
# Configuration # Configuration
__uaddpath "@@dest@@" PATH __uaddpath "@@dest@@" PATH