hledger/tests/ui/hledgerui2txt
2020-11-11 16:03:52 -08:00

5 lines
256 B
Bash
Executable File

#!/bin/sh
# Convert hledger-ui's output to plain text. Extracted from uitest.sh, see comments there.
exec perl -pe 's/\e\[\d+;1H/\n/g; s/\e\[?.*?[\@-~]//g; s/$/\n/;' | \
perl -ne 's/(─)+/---/; s/(─)+//; s/ +$//; print unless /^$/' # or /\?:help/'