dev tools: Print the test data to stdout for convenience.

This commit is contained in:
Daniel Shahaf 2020-01-07 19:59:49 +00:00
parent de95d50bce
commit 6f1f595e3e

View File

@ -55,15 +55,15 @@ _zsh_highlight_add_highlight()
# Copyright block
year="`LC_ALL=C date +%Y`"
if ! read -q "?Set copyright year to $year? "; then
if ! { read -q "?Set copyright year to $year? " } always { echo "" }; then
year="YYYY"
fi
exec >$fname
<$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/"
<$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/" > $fname
# Assumes stdout is line-buffered
git add -- $fname
# Buffer
exec > >(tee $fname)
print -n 'BUFFER='
if [[ $buffer != (#s)[$'\t -~']#(#e) ]]; then
print -r -- ${(qqqq)buffer}