mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Added: hide/show cursor for git-effort(1)
since it looks really funny otherwise
This commit is contained in:
parent
38cba1a781
commit
6aa2944727
|
|
@ -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
|
||||
Loading…
Reference in a new issue