Die if there are any newlines inside the task text
The `t` file format is line-based, so newlines break the file format. We'd have
to escape them or something, but that opens a whole can of worms, and `t` is
supposed to be simple, so we'll just forbid them.
Fixes https://github.com/sjl/t/issues/26
author |
Steve Losh <steve@stevelosh.com> |
date |
Sat, 11 Apr 2020 11:23:45 -0400 |
parents |
6af374f52295 |
children |
d76f573934d1 |
Setup:
$ alias xt="python $TESTDIR/../t.py --task-dir `pwd` --list test"
Replace a task's text (preserving the ID):
$ xt Sample.
$ xt
a - Sample.
$ xt -e a New sample.
$ xt
a - New sample.
$ xt 'this | that'
$ xt
4 - this | that
a - New sample.
$ xt -e 4 'this &| that'
$ xt
4 - this &| that
a - New sample.
Sed-style substitution:
$ xt -e a 's/New/Testing/'
$ xt
4 - this &| that
a - Testing sample.
$ xt -e 4 '/this &/this /'
$ xt
4 - this | that
a - Testing sample.