todotxt / todo.txt-cli

☑️ A simple and extensible shell script for managing your todo.txt file.
http://todotxt.org
GNU General Public License v3.0
5.55k stars 712 forks source link

Ignore lines that begin with hash symbol `#` #425

Open lamyergeier opened 8 months ago

lamyergeier commented 8 months ago

Do you want to request a feature or report a bug? Feature

What is the current behavior?

My todo.txt has first line (to remind me of the format)

#(Priority) CreationDate Task @Context +Project
$ todo.sh ls
1 #(Priority) CreationDate Task @Context +Project
2 (A) 2023-12-13 Frau Casse: Status of requested documents
--
TODO: 2 of 2 tasks shown

What is the expected behavior?

Could you please ignore lines that begin with hash symbol #?

$ todo.sh ls
1 (A) 2023-12-13 Frau Casse: Status of requested documents
--
TODO: 1 of 1 tasks shown

Which versions todo.sh are you using?

Run todo.sh -V

$ todo.sh -V TODO.TXT Command Line Interface v@DEV_VERSION@

Which Operating System are you using? Fedora 39

Which version of bash are you using?

Run bash --version

GNU bash, version 5.2.21(1)-release (x86_64-redhat-linux-gnu)

inkarkat commented 8 months ago

The todo.txt format is standardized, and there are many different clients (that would ideally all support this format extension). That makes it really difficult to add this feature.

As a hack, a custom pre_filter_command could be used to hide those lines, but that would be incomplete and the counts would still be off.

I'd therefore challenge your assumptions: If you use the CLI to manage tasks, the actual syntax is irrelevant; the tool ensures certain things (like position of priority and dates), and stuff like context and project position is flexible (it's just your personal preference to put them at the end). After a few days of use, there should be enough existing tasks that even when editing manually, there's enough existing context to infer the syntax.

With advanced use (and many add-ons), a one-line reminder won't be enough, anyway. My solution has been to write a simple cheat sheet as a custom add-on that I can call up with todo.sh cheat.