rearrange code sections

This commit is contained in:
nojhan 2012-07-19 11:21:18 +02:00
parent fc2e64b7f0
commit 2d12736fb3

View File

@ -131,9 +131,9 @@ __host_color()
echo -ne "${ret}${NO_COL}" echo -ne "${ret}${NO_COL}"
} }
##################################### ################
# Count the number of attached jobs # # Related jobs #
##################################### ################
# Either attached running jobs (started with $ myjob &) # Either attached running jobs (started with $ myjob &)
# or attached stopped jobs (suspended with Ctrl-Z) # or attached stopped jobs (suspended with Ctrl-Z)
@ -155,6 +155,15 @@ __jobcount_color()
echo -ne "$rep" echo -ne "$rep"
} }
# Display the return value of the last command, if different from zero
__return_value()
{
if [ "$1" -ne "0" ]
then
echo -ne "$1"
fi
}
###################### ######################
# VCS branch display # # VCS branch display #
@ -376,6 +385,11 @@ __load_color()
fi fi
} }
##########
# DESIGN #
##########
# Set the prompt mark to ± if VCS, # if root and else $ # Set the prompt mark to ± if VCS, # if root and else $
__smart_mark() __smart_mark()
{ {
@ -391,15 +405,6 @@ __smart_mark()
fi fi
} }
# Display the return value of the last command, if different from zero
__return_value()
{
if [ "$1" -ne "0" ]
then
echo -ne "$1"
fi
}
# space right # space right
__sr() __sr()
{ {
@ -424,6 +429,11 @@ __sb()
fi fi
} }
########################
# Construct the prompt #
########################
__set_bash_prompt() __set_bash_prompt()
{ {
# left of main prompt # left of main prompt
@ -456,9 +466,6 @@ __set_bash_prompt()
# Avoid glitches after interrupting a command with Ctrl-C # Avoid glitches after interrupting a command with Ctrl-C
PS1="\[\033[G\]${PS1}${NO_COL}" PS1="\[\033[G\]${PS1}${NO_COL}"
} }
########################
# Construct the prompt #
########################
PROMPT_COMMAND=__set_bash_prompt PROMPT_COMMAND=__set_bash_prompt