From d12b20416bbc1aba52c7320f21797af31afad358 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 5 Jun 2012 15:10:25 +0200 Subject: [Prompts] compilation : adds static/dynamic info into prompt --- net:foret/Prompts.zsh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'net:foret') diff --git a/net:foret/Prompts.zsh b/net:foret/Prompts.zsh index cf741c0..817330f 100644 --- a/net:foret/Prompts.zsh +++ b/net:foret/Prompts.zsh @@ -13,14 +13,26 @@ _prompt_colors[target]="1;31" __compilation () { unset COMPILATION - if [ -n "$TARGET" -o $((${V:-0} + ${NPROC:-0})) -gt 0 ] + if [ -n "$TARGET" -o -n "$STATIC" -o -n "$DYNAMIC" -o $(( ${V:-0} + ${NPROC:-0} )) -gt 0 ] then COMPILATION="[" - COMPILATION+=$C_$_make_colors[target]$_C${TARGET:+$TARGET}$C_$_prompt_colors[soft_generic]$_C + + [ $(( ${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))} + ${DYNAMIC:-$(( 1 ^ ${STATIC:-0} ))} )) -lt 2 ] && \ + case "${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))}${DYNAMIC:-$((1 ^ ${STATIC:-0}))}" in + "10") + COMPILATION+=$C_$_make_colors[dynamic]$_C"static"$C_$_prompt_colors[soft_generic]$_C ;; + "01") + COMPILATION+=$C_$_make_colors[target]$_C"dynamic"$C_$_prompt_colors[soft_generic]$_C ;; + esac + + COMPILATION+=$C_$_make_colors[target]$_C$TARGET$C_$_prompt_colors[soft_generic]$_C + [ -n "$V" -a "$V" -gt 0 ] && \ COMPILATION+=$C_$_make_colors[verbose]$_C$(for i in {1..$V} ; echo -n "V")$C_$_prompt_colors[soft_generic]$_C + [ -n "$NPROC" -a "$NPROC" -gt 0 ] && \ COMPILATION+=$C_$_make_colors[nproc]$_C$(for i in {1..$NPROC} ; echo -n "|")$C_$_prompt_colors[soft_generic]$_C + COMPILATION+="] " fi } -- cgit v1.2.3