summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Baylis <charles.baylis@linaro.org>2015-02-25 16:12:16 +0000
committerCharles Baylis <charles.baylis@linaro.org>2015-02-25 16:32:32 +0000
commitfcaeede4478c283f86cd5782b951d788ba4db8e9 (patch)
tree131181b14b431c7d326e70bb6549e2a72c69a999
parent5f590ee94178a5590d165a8bc14c8ed6b859b70a (diff)
Use bold instead of white in message colouring
In order to support use of backflip on terminals with both white and black backgrounds, use the control code for bold instead of the code for white in prompts and messages.
-rwxr-xr-xbackflip30
1 files changed, 15 insertions, 15 deletions
diff --git a/backflip b/backflip
index c40879b..c7e90a8 100755
--- a/backflip
+++ b/backflip
@@ -22,7 +22,7 @@ NC='\e[0m'
red='\e[0;31m'
blue='\e[1;34m'
green='\e[0;32m'
-white='\e[1;37m'
+bold='\e[1m'
lines=`perl -E 'say "-" x 80'`
# ==============================================================================
@@ -53,9 +53,9 @@ forge_entry() {
| grep ^+ \
| sed -e '1d' -e 's:^+::' \
| awk '$1 ~ /^2.*$/ {print "\t"$0} $1 !~ /^2.*$/ {print $0}' >> $2.bcp
- print_info "${white}Forged ChangeLog entry:${NC}"
+ print_info "${bold}Forged ChangeLog entry:${NC}"
cat $2.bcp
- ask "${white}Editing [N/y] ?" user_edit
+ ask "${bold}Editing [N/y] ?" user_edit
if [ "$user_edit" == "y" ]; then
"$EDITOR" $2.bcp
fi
@@ -65,8 +65,8 @@ forge_entry() {
print_step "Finding SHA1"
# ==============================================================================
SHA1=`git log --format=format:"%H" --grep=trunk@${1} master`
-print_info "${NC}SVN rev ${white}${1}${NC} SHA1: ${white}${SHA1}${NC}"
-ask "${white}Watch the commit [N/y] ?" user_watch
+print_info "${NC}SVN rev ${bold}${1}${NC} SHA1: ${bold}${SHA1}${NC}"
+ask "${bold}Watch the commit [N/y] ?" user_watch
if [ "$user_watch" == "y" ]; then
git show $SHA1
fi
@@ -98,37 +98,37 @@ done
print_step "Status Checking"
# ==============================================================================
git status
-ask "${white}Open a Shell [N/y] ?" user_shell
+ask "${bold}Open a Shell [N/y] ?" user_shell
if [ "$user_shell" == "y" ]; then
- PROMPT_COMMAND="echo -n -e '${white}[${red}BackFLiP${white}] '" bash
+ PROMPT_COMMAND="echo -n -e '${bold}[${red}BackFLiP${NC}${bold}]${NC} '" bash
fi
# ==============================================================================
print_step "Branch/Commit/Push/Review"
# ==============================================================================
bname=${VERSION}-backport-${1}
-ask "${white}Create backport branch [Y/n] ?" user_bc
+ask "${bold}Create backport branch [Y/n] ?" user_bc
if [ "$user_bc" != "n" ]; then
- ask "${white}Change name (${blue}${bname}${white}) [N/y] ?" user_bname
+ ask "${bold}Change name (${blue}${bname}${NC}${bold}) [N/y] ?" user_bname
if [ "$user_bname" == "y" ]; then
- ask "${white}Enter name :" bname
+ ask "${bold}Enter name :" bname
fi
git checkout -b ${bname} origin/${LINARO_REF_BRANCH}
- ask "${white}Commit backport [Y/n] ?" user_commit
+ ask "${bold}Commit backport [Y/n] ?" user_commit
if [ "$user_commit" != "n" ]; then
git commit
- ask "${white}Create patch [Y/n] ?" user_patch
+ ask "${bold}Create patch [Y/n] ?" user_patch
if [ "$user_patch" != "n" ]; then
git format-patch -o ../ --suffix=.${bname}.patch -1
fi
- ask "${white}Push ${bname} branch [Y/n] ?" user_push
+ ask "${bold}Push ${bname} branch [Y/n] ?" user_push
if [ "$user_push" != "n" ]; then
git push origin ${bname}:${bname}
- ask "${white}Request review (amend commit) [Y/n] ?" user_review
+ ask "${bold}Request review (amend commit) [Y/n] ?" user_review
if [ "$user_review" != "n" ]; then
git commit --amend
git review $LINARO_REF_BRANCH
@@ -139,7 +139,7 @@ if [ "$user_bc" != "n" ]; then
fi
# ==============================================================================
-ask "${white}Abort and Cleanup [N/y] ?" user_abort
+ask "${bold}Abort and Cleanup [N/y] ?" user_abort
# ==============================================================================
if [ "$user_abort" == "y" ]; then
git reset --hard