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 # Copyright block
year="`LC_ALL=C date +%Y`" 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" year="YYYY"
fi fi
exec >$fname <$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/" > $fname
<$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/"
# Assumes stdout is line-buffered # Assumes stdout is line-buffered
git add -- $fname git add -- $fname
# Buffer # Buffer
exec > >(tee $fname)
print -n 'BUFFER=' print -n 'BUFFER='
if [[ $buffer != (#s)[$'\t -~']#(#e) ]]; then if [[ $buffer != (#s)[$'\t -~']#(#e) ]]; then
print -r -- ${(qqqq)buffer} print -r -- ${(qqqq)buffer}