In verbose mode, commands first print the updated task, then summarize the change in the following line.
The add/addm/addto commands deviated from this, using "TODO: '<task>' added on line N."
This change splits this into two separate lines, obsoletes the implementation jargon of "line", and makes it easier to visually parse the message.
This is also a preparation for a possible future use of a _list()-like function, so that the updated task is processed and highlighted like the normal task output.
Added proper quoting at check for search term starting with a dash.
Added tests for ls use with TERM, both with literal text and regexps. Seems that use case was missing from the tests so far.
Extra: Removed unnecessary "$@" argument to for() loop.
The help and messages now consistently use "task"; the use of "todo" is deprecated.
"ITEM#" is used to refer to the number of the task. This may be more consistently expressed as "TASK#". On the other hand, that could lead to more confusion between TASK (the text) and TASK# (the number).
The implementation still leaks through in the phrase "on line ITEM#"; ideally, todo.txt would abstract over the line-based textual representation.
On "todo.sh help", first the long help output is printed through the pager, and
after quitting the pager the output is printed once more in full.
Didn't write a test for this, as this requires a connected terminal and cannot
be observed in the test harness.
Fix: The "exec" command has no effect inside a pipe; added an explicit "exit 0".
Also simplified check for PAGER: No "exec" necessary, combining stderr and
stdout.
Also added quoting for PAGER so that it can contain spaces.
Versions of bash before 3.0 do not have =~ syntax to match on a regex.
Changed to using a simple grep -c test instead.
Fixes issues with osx and Solaris 9 and before.
- _list() now shows the capitalized filename in place of 'TODO:'.
For example, listing garden.txt produces a output prefixed by 'GARDEN:'
This eliminates the ' from $FILE' part of the _list() output. All tests
were adjusted to match this new output.
- 'add' and 'addm' now 'addto' with $TODO_FILE instead of user supplied file
- 'addto' now shows the capitalized filename in place of 'TODO:'.
For example, adding to garden.txt produces a output prefixed by 'GARDEN:'
(Probably the most controversial part of this commit and up for
discussion. If kept, the 'listfile' output should be made to match.
Note that this convention would then minimize standard output by
dropping the file name.)
- All existing add/addm/add-date tests pass. Two new test sequences were
added to test 'addto' and 'listfile' functionality.
- A space/tab nuissance was cleared up in the tests/README file.
* Fixed regex in `_list` to exclude lines that begin with whitespace,
as the ' ' => '0' replacement hadn't yet been performed.
* Added test cases to `t1300-ls.sh` to check for this condition.
Using the cleaninput function, to escape &'s on certain actions.
Currently the actions needing escaped &'s are append, prepend and replace.
Other actions including add need unescaped &'s.