summaryrefslogtreecommitdiff
path: root/net:foret
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2012-06-07 10:09:51 +0200
committerHugues Hiegel <hugues@hiegel.fr>2012-06-07 10:10:36 +0200
commit791d76d44324badcd53a886b4ad291b38ae1544f (patch)
tree8f991ff2c059c907473f61ee2a396d317af4ae1c /net:foret
parent80fbf9030738cbfea38bdd6a049ea828882328dd (diff)
[Prompt] Q : displays tasks/extra_info in bold if EXPORTED.
Diffstat (limited to 'net:foret')
-rw-r--r--net:foret/Colors.zsh10
-rw-r--r--net:foret/Prompts.zsh27
2 files changed, 24 insertions, 13 deletions
diff --git a/net:foret/Colors.zsh b/net:foret/Colors.zsh
index ffe5758..d56bcbd 100644
--- a/net:foret/Colors.zsh
+++ b/net:foret/Colors.zsh
@@ -1,9 +1,9 @@
typeset -A _make_colors
-_make_colors[target]="31;1"
-_make_colors[verbose]="33;1"
-_make_colors[nproc]="33;1"
-_make_colors[static]="32;1"
-_make_colors[dynamic]="33;1"
+_make_colors[target]=$color[red]
+_make_colors[verbose]=$color[yellow]
+_make_colors[nproc]=$color[yellow]
+_make_colors[static]=$color[green]
+_make_colors[dynamic]=$color[yellow]
diff --git a/net:foret/Prompts.zsh b/net:foret/Prompts.zsh
index 3524614..ea197f9 100644
--- a/net:foret/Prompts.zsh
+++ b/net:foret/Prompts.zsh
@@ -15,31 +15,42 @@ __static_dynamic ()
[ $(( ${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))} + ${DYNAMIC:-$(( 1 ^ ${STATIC:-0} ))} )) -lt 2 ] && \
case "${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))}${DYNAMIC:-$((1 ^ ${STATIC:-0}))}" in
"10")
- echo $C_$_make_colors[static]$_C"static" ;;
+ echo -n $C_
+ export | grep -q '^DYNAMIC=' && echo -n "1;"
+ echo -n $_make_colors[static]$_C"static" ;;
"01")
- echo $C_$_make_colors[dynamic]$_C"dynamic" ;;
+ echo -n $C_
+ export | grep -q '^STATIC=' && echo -n "1;"
+ echo -n $_make_colors[dynamic]$_C"dynamic" ;;
esac
}
__compilation_target ()
{
- [ -n "$TARGET" ] && echo $C_$_make_colors[target]$_C$TARGET
+ [ -n "$TARGET" ] || exit
+ echo -n $C_
+ export | grep -q '^TARGET=' && echo -n "1;"
+ echo -n $_make_colors[target]$_C$TARGET
}
__verbose_compilation ()
{
- [ -n "$V" -a "$V" -gt 0 ] && \
- echo $C_$_make_colors[verbose]$_C$(for i in {1..$V} ; echo -n "V")
+ [ -n "$V" -a "$V" -gt 0 ] || exit
+ echo -n $C_
+ export | grep -q '^V=' && echo -n "1;"
+ echo -n $_make_colors[verbose]$_C$(for i in {1..$V} ; echo -n -n "V")
}
__nproc_compilation ()
{
- [ -n "$NPROC" -a "$NPROC" -gt 0 ] && \
- echo $C_$_make_colors[nproc]$_C$(for i in {1..$NPROC} ; echo -n "|")
+ [ -n "$NPROC" -a "$NPROC" -gt 0 ] || exit
+ echo -n $C_
+ export | grep -q '^NPROC=' && echo -n "1;"
+ echo -n $_make_colors[nproc]$_C$(for i in {1..$NPROC} ; echo -n -n "|")
}
__makeflags ()
{
- echo $MAKEFLAGS
+ echo -n $MAKEFLAGS
}
PS1_TASKBAR+=(__makeflags __verbose_compilation __nproc_compilation)