Sorting of output? #331
-
I don't understand what mechanism is doing the sorting of output when I "list" items using todo.sh. My specific goal is to be able to sort by due date rather than priority when I need to, but I'd also like to understand how sorting happens in general. I'm competent to understand a moderately unixy explanation and to make minor modifications to todo.sh. If this is documented somewhere, just point me there, but I can't find it. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Due dates are typically set via a
So, it will look something like this:
It should not be necessary to modify |
Beta Was this translation helpful? Give feedback.
TODOTXT_SORT_COMMAND
is mentioned in the default todo.cfg. This is a Bash command-line (a command or a pipeline of commands that typically includes thesort
command) thats gets the (somewhat preprocessed) tasks via standard input, reorders the lines, and then hands them back via standard output to the colorization stage insidetodo.sh
.Due dates are typically set via a
t:<date>
ordue:<date>
marker. As these can occur anywhere in the task text, sorting based on the date is a bit difficult. The usual approach is