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.59k stars 713 forks source link

add due coloring support #253

Closed krisko closed 4 years ago

krisko commented 6 years ago

Hello, this pull request adds color support for entries with due date in todo.txt.

Usage and test is as simple as creating todo item with due date formated as: due:2018-05-21

karbassi commented 6 years ago

Thanks @krisko for this wonderful PR. We'll review it and get back to you.

My thoughts are that since due:* isn't part of the native client, I believe this should be part of the due add-on.

Quick question for you @inkarkat & @ginatrapani: can add-ons affect the CLI's highlighting?

inkarkat commented 6 years ago

Yes, the highlighting can be extended via TODOTXT_FINAL_FILTER. Unlike an add-on, this requires a single line of configuration in todo.cfg; you can't just drop the custom filter in a directory. (The ordering of filters may be important, too, so explicit configuration is the right approach, and not just a case of an automatic approach not being implemented yet.)

So, unless we decide to incorporate the due: prefix in the official spec and the CLI client, this shouldn't be added here. The CLI is so highly configurable, I'd rather continue to keep the core lean and small than opening the gates to adding this and that add-on. Nothing prevents some eager volunteer to assemble a custom distribution of todo.sh that ships with many add-ons and customizations out of the box...