Added: hide/show cursor for git-effort(1)

since it looks really funny otherwise
This commit is contained in:
Tj Holowaychuk 2012-02-08 16:40:26 -08:00
parent 38cba1a781
commit 6aa2944727

View file

@ -12,6 +12,24 @@ date() {
git log --pretty='format: %ai' $1 | cut -d ' ' -f 2
}
#
# hide cursor
#
hide_cursor() {
printf '\033[?25l'
}
#
# show cursor
#
show_cursor() {
printf '\033[?25h'
printf '\033[m\n'
exit 1
}
#
# get active days for the given <commit>
#
@ -42,6 +60,11 @@ color_for() {
test "$1" = "--above" && above=$2
# hide cursor
hide_cursor
trap show_cursor INT
# heading
echo
@ -67,3 +90,5 @@ for file in $files; do
printf "\033[${color}m %d\033[0m\n" $active
done
echo
show_cursor