Skip to content
Snippets Groups Projects
Commit e6a61d1d authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

added showPrompt

parent a704e623
No related branches found
No related tags found
1 merge request!1Version 2
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
typeset -i rc=0 typeset -i rc=0
# Fetch returncode of last executed command.
# It summarizes all exitcodes into rc (= if any job failed it is <> 0)
# It stores the last exitcode in myrc
function fetchrc(){ function fetchrc(){
myrc=$? myrc=$?
echo rc=$myrc echo rc=$myrc
...@@ -21,6 +23,9 @@ function fetchrc(){ ...@@ -21,6 +23,9 @@ function fetchrc(){
# ------------------------------------------------------------ # ------------------------------------------------------------
# color text # color text
# ------------------------------------------------------------ # ------------------------------------------------------------
# set a terminal color by a keyword
# param string keyword to set a color; one of reset | head|cmd|input | ok|warning|error
function color(){ function color(){
sColorcode="" sColorcode=""
case $1 in case $1 in
...@@ -44,6 +49,12 @@ function fetchrc(){ ...@@ -44,6 +49,12 @@ function fetchrc(){
fi fi
} }
function showPrompt(){
color input
echo -n "$*"
color reset
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# headlines # headlines
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
...@@ -68,7 +79,8 @@ function fetchrc(){ ...@@ -68,7 +79,8 @@ function fetchrc(){
function h3(){ function h3(){
color head color head
echo "----- $*" echo
echo "---------- $*"
color reset color reset
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment