1 .TH "tdl" 1 "May 2003" "1.4"
3 tdl \- To do list manager
7 tdl [\-q] add|edit|defer|log
9 tdl [\-q] list|done|undo|report
11 tdl [\-q] remove|above|below|into|clone|copyto
13 tdl [\-q] postpone|ignore|open
15 tdl [\-q] which|version|help
28 A program for managing a to-do list.
30 tdl has a set of functions that can be accessed in two different ways:
32 * Directly from the command line
35 In the 'direct' method, the function and its arguments are provided on the
36 command line. This mode is useful if you only want to perform a single
42 The 'interactive' method is entered when the tdl command is run with no
43 arguments. In this mode, many tdl operations may be performed within a
44 single run of the program. This avoids loading and saving the database
45 for each operation, which may have a small performance benefit.
46 However, if the program is compiled with the readline library, the
47 <tab> key will provide various completion functions. An example
54 When in interactive mode, these methods can be used to exit and return
59 command (see exit command)
61 * Hitting <Ctrl-D> (i.e. end of file on stdin)
63 * Hitting <Ctrl-C>, <Ctrl-\> etc. The associated signals are caught by
64 tdl and it will attempt to save the database. However, this method is
65 more risky than the first two.
69 command (see quit command). Caution: this does not save the
70 modified database back to the disk. Only use it if you want to discard
71 all changes made in this tdl run.
76 as the first command line argument. Currently, this suppresses the warning
77 message if no existing database can be found. The intended use is for using
79 when changing into a directory, to list outstanding work in that directory.
81 Any command that modifies the database will rename the old database to a file
84 before writing out the new
86 (The backup file will be in the same directory as the main one.) This allows
87 for one level of database recovery, if the database is corrupted or a command
88 is issued in error which causes large losses of data (e.g. misuse of the
95 .I index_to_insert_above
99 .I index_to_insert_above
102 This command moves one or more entries to a new location in the tree. The
103 first index specifies the entry which will end up immediately below the moved
104 entries after the operation. As a special case, you can specify the final
105 component of the first argument as zero. In this case, the moved entries
106 appear as the last children of the parent node afterwards.
125 command is used to add a new entry to the database.
128 is the time at which the entry will be visible when the database is printed
131 command. It defaults to now. The format for datespec is described in the
132 .B "DATE SPECIFICATION"
133 section later in this page.
136 is the index of the parent node (e.g. 1 or 2.4). This defaults to the root
137 node if missing, i.e. a new top-level entry is created.
139 .B priority is one of
145 Normal is the default if this argument is not specified. Priorities may be
146 abbreviated (even to just the first letter.)
149 is the text describing the task for this entry. If this is more than a single
150 word, you will need to quote it to make the shell keep it as a single argument
151 to tdl. The text may span multiple lines (i.e. if you hit return whilst the
152 quotation marks are still open in the shell.)
154 If no database exists, the
156 command will create it automatically (in the current directory, unless the
158 environment is set, in which case this specifies the path to use).
164 .I index_to_insert_below
168 .I index_to_insert_below
171 This command moves one or more entries to a new location in the tree. The
172 first index specifies the entry which will end up immediately above the moved
173 entries after the operation. As a special case, you can specify the final
174 component of the first argument as zero. In this case, the moved entries
175 appear as the first children of the parent node afterwards.
181 .I index_to_clone ...
183 The clone command can be used to make a deep copy of one or more entries and
184 add them as new top-level entries in the database. You might use this if you
185 have a task with a set of subtasks, and find that the same subtasks apply to
186 some new task. You could copy the first task, and edit the new top-level task
194 .I index_to_clone ...
196 The copyto command is very similar to the
198 command. The difference is that copyto inserts the newly created entries as
199 children of an existing entry, rather than making them new top level entries.
206 This command is used to create a .tdldb file in the current
207 directory (or at the location specified by the environment variable
208 TDL_DATABASE). If the database file is already found to exist, a warning will
209 be printed and the command has no effect.
211 The situation where you are likely to use this command is where there is
212 already a .tdldb file in another directory further up the path from this one.
213 Most of the tdl commands will find and use this other database file, assuming
214 that you want to share it across all the directories in the tree. You might
215 want to use a single database across an entire large project, for example. The
217 command will ignore any .tdldb file found in an ancestor directory. It always
218 operates in either the current directory or on the file pointed to by
226 .I index_to_change...
228 The defer command is used to modify the start-time of one or more existing entries,
229 where the @ on the datespec is optional because the argument is required, although
230 the @ can be included for consistency with other commands where a datespec is optional.
234 tdl> defer @+fri 1 2.1... 5
236 which defers entries 1, 2.1 and all its children, and 5 until the following Friday.
237 To list deferred entries, use
239 , to defer entries indefinitely, see
242 To re-activate deferred or postponed entries, see
251 .I index_of_done_entry ...
255 .I index_of_done_entry ...
259 command is used to mark one or more tasks as completed. The effects are as follows:
261 The entries no longer appear on the default listing (tdl list / tdll)
263 The entries are eligible to appear on the report list (tdl report)
265 The entries are eligible for removal by the purge command (tdl purge.)
267 If the string "..." is appended to an index, it means that entry and all its
268 descendents. This provides a quick way to mark a whole sub-tree of tasks as
272 is the time at which the entry/entries should be marked as having been
273 completed. The default is to mark them completed at the current time. The
274 competion time of an entry affects whether it is shown by the
276 command for a particular range of reported times.
278 The format for datespec is described in the
279 .B "DATE SPECIFICATION"
280 section later in this page.
289 This command is used to change the text of an entry. If no [new-text] is
290 provided, you will be prompted with the old text to edit interactively. (This
291 is only useful if the GNU readline library has been linked in.)
293 Note, in earlier versions, edit could be used to change the start-time of one
294 or more entries. This is now handled by the
303 The exit command is used to exit from tdl when it is used in interactive mode.
304 The exit command is not available in the command line mode, where it would not
307 The exit command writes any pending updates to the database before exiting.
310 command, which loses all updates made during the current tdl run.
317 .I index_to_export ...
319 This command is used to create a new TDL database (whose name is given by the
321 argument). The initial contents of the new database are the entries specified
322 by the list of indices following the filename, in that order. Each index
323 becomes a top-level entry of the new database. The operation is read-only on
324 the original database.
331 This command displays a summary of use of each of the commands.
337 .I index_to_ignore ...
339 The ignore command puts one or more entries into an ignored state. It is
340 actually implemented in the same way as marking them as done, but as though
341 they were done a very long time ago. Thus, ignored entries will be deleted
342 by any subsequent purge operation.
344 I added this feature because, when applying remove to several entries, I kept
345 getting tripped up by the indices changing below the entry that was removed
346 (I kept removing the wrong entries later by not using the revised indices).
347 Instead, I can ignore them and rely on a periodic purge to clean up the database.
349 Another use for the ignore command would be to move moribund entries into a
350 wastebasket to stop them cluttering up the normal listing, but without removing
351 them entirely in case you need to reprieve them later.
353 If you need to un-ignore an entry, just
363 This command is used to merge entries from the TDL database
365 into the default TDL database (i.e. the one that most of the other commands
368 You might use this command if you had a number of separate TDL databases, and
369 wanted to merge their entries to form one combo database.
376 .I indices_to_move ...
378 This command moves one or more entries under a new parent entry. It is
383 argument has ".0" appended to it.
395 .I [<parent_index>|<search_conditions>...]
404 .I [<parent_index>|<search_conditions...]
413 .I [<parent_index>|<search_conditions...]
419 command is used to display the entries in the database. By default, only
420 entries that have not been marked
422 and which don't have start times deferred into the future are shown. If you
423 want to display all entries, include the
425 option (which means 'all'). If you want to display the dates and times when
426 the entries were added and/or done, include the
428 option (which means 'verbose').
431 option stands for postponed. It means that tasks which are 'deferred' or 'postponed'
432 are shown as well as open tasks.
434 By default, only entries having normal, high or urgent priority are shown. To
435 change the minimum priority shown, specify the
437 argument. For example, 'tdll h' will only show entries with priority high or
440 By default, the whole database is scanned. If you only want to show part(s) of
441 the database, additional arguments can be given. These are the indices of the
442 top node of each part of the database you want to show. So if your database
443 contains entries with indices 1, 2, 2.1, 2.2, 2.2.1, 3 and 4, the command
447 will show all entries 2, 2.1, 2.2 and 2.2.1, whether or not they are completed.
449 Also by default, all entries in the database, at any depth, will be shown. If
450 you only wish to show 'top-level' entries, for example, you can use
454 This lists level-1 entries. Any level-1 entry with hidden child entries
455 underneath it will show a summary of how many such children there are. For
458 3 [2/7] A top level entry
460 means that the entry with index 3 has a total of 7 entries underneath it, of
461 which 2 are still open and 5 are completed (i.e. they've had 'tdl done' applied
464 Because the single digit arguments are used this way for the 'list' subcommand,
465 the normal 'negative index' method can't be used to specify an entry a certain
466 distance from the end of the list. If you want to do this, use a syntax like
470 to show the last index in the array, or
472 tdl list \-2 \-\- \-3 \-2 \-1
474 to show level-1 and level-2 entries within the last 3 level-1 entries in the
479 specifies a case-insensitive substring match that is applied to all parent
480 indices further on in the arguments. (If no parent indices are given, all the
481 search conditions are and'ed together and applied to filter all the nodes that
482 would be shown according to the depth, priority etc arguments).
484 Each search condition takes one of the following forms
489 In each case, an entry will match if substring is actually a substring of the
490 text of that entry. In the second form (where the number may be 0, 1, 2 or 3),
491 a match occurs if there are up to that many errors in the substring. An error
492 is a single character inserted, removed or changed.
494 This option is most useful if you have a large database and can remember you
495 have an entry somewhere containing particular word(s), but can't remember where
498 If you need regular expression matching, the best approach would be to run
499 tdll from the shell and pipe the output to grep. The internal matching does
500 approximate matches with keys up to 31 characters.
502 By default, the listing is produced with colour highlighting. The
504 option can be used to produce a monochrome listing instead. Alternatively, the
505 .B TDL_LIST_MONOCHROME
506 enviroment variable can be set (to any value) to achieve the same effect.
508 The colours are assigned as follows:
517 Yellow & High priority task
518 White & Normal priority task
519 Cyan & Low priority task, done task
520 Blue & Very low priority task
532 This command is used to add a new entry and mark it done immediately. It is
533 most useful in conjunction with the
535 command, to record unexpected extra tasks you had to do.
537 The arguments for the
539 command are the same as those for the
552 command can be used to limit the effects of later commands to operate within
553 a particular sub-tree of your database. Because the indices you specify for
554 the later operations have the common prefix omitted, this can save typing if
555 you have many changes to make within the same subtree.
557 If your listings are in colour, the common prefix is coloured in blue whilst
558 the paths below the root of the sub-tree are shown in the usual green.
559 (In monochrome mode, there is no distinction.)
561 Whilst your view is narrowed, the index of the sub-tree root is shown in square
562 brackets between tdl and > (i.e. [2]).
564 If you want to operate on the sub-tree root entry itself whilst you are
565 narrowed, you can use . to specify its index (think: current directory in Unix.)
567 To reverse the effects of the narrow command, use the
569 command (see widen command).
571 This command is only available when tdl is being run interactively, i.e. when
572 you have a tdl prompt. It is not available directly from the shell (where it
573 wouldn't make much sense).
579 .I index_to_reopen[...] ...
581 The open command is used to reverse the effect of the
583 command. Its effect is actually to set the arrival time of the entries to the
590 .I index_to_postpone[...] ...
592 The postpone command is used to make 1 more more entries postponed. Its effect
593 is actually to set the arrival time of the entries a long way in the future
594 (i.e. it's an extreme form of the 'deferred' feature available through the add and
595 defer commands.) Postponed entries can be re-activated with the
604 .I index_to_change ...
606 This command changes the priority of one or more entries. The indices are in
607 the same format as those in the output of the
611 argument takes the same possible values as for the
622 This command is used to remove old done entries from the database. It is much more convenient than repeated
628 argument specifies a time. The format for this argument is described in the
629 .B "DATE SPECIFICATION"
630 section later. Entries that were marked done (using the
632 command) before that epoch will be purged.
636 may be given. These restrict the purging to just those entries and their
637 descendents. The default is to purge the entire database.
644 The quit command is used to exit from tdl when it is used in interactive mode.
645 The quit command is not available in the command line mode, where it would not
648 The quit command DOES NOT write any pending updates to the database before
651 command, which does write all updates made during the current tdl run.
653 The main use for the quit command would be to avoid damaging the database if a serious error had been made.
659 .I index_to_remove ...
662 .I index_to_remove ...
664 Completely remove one or more entries from the database. The indices are the
665 same format as those shown in the output of the
669 If the string "..." is appended to an index, it means that entry and all its
670 descendents. This provides a quick way to remove a whole sub-tree of tasks.
681 command produces a report (in bulleted list format) of tasks completed in a
682 certain time period. This is useful if (for example) you have to write a
683 weekly summary of the work you've done.
685 The default for the end of the time period is the current time, if the
687 argument is not present. The start of the period to report on must always be
688 specified. The format for the time arguments is described in the
689 .B "DATE SPECIFICATION"
695 will list all tasks completed in the previous week, whereas
699 will list all tasks completed between 2 and 1 weeks ago.
701 Where a child entry has been completed in the reporting period, but its parent
702 has not been completed, the parent text in the report will be surrounded by
703 '[[' and ']]'. To give one example, this will happen if the parent has other
704 child entries that haven't been completed yet.
711 The revert command discards any changes made in the session and reloads the
712 in-memory database from disc. If you have used the
714 command in the session, the database will revert to its state at the most
715 recent save. Otherwise it will revert to its state when tdl was initially run.
717 The revert command does not take any arguments.
726 command can be used to write the current in-memory database out to the disc
727 database file. The behaviour is currently equivalent to the command exit
728 followed by re-running tdl from the shell.
730 This command is useful if you tend to do long interactive tdl sessions.
731 It guards against the risks of
733 1. accidentally typing quit when you meant exit
737 3. running tdl in another window and seeing a stale copy of the database file.
739 The save command does not take any arguments.
745 .I index_of_entry_to_undo ...
747 This command cancels the effect of the
749 command for one or more entries, e.g. after they have been mistakenly marked as
752 If the string "..." is appended to an index, it means that entry and all its
753 descendents. This provides a quick way to re-open a whole sub-tree of tasks.
769 Show the version number of the software.
776 Show the filename of the database that tdl accesses in the current context.
784 The optional n_levels parameter tells tdl how many levels to widen the view.
785 If the parameter is not specified, it defaults to 1. If you try to widen more
786 levels than the depth of the current sub-tree root node, the widening will be
787 silently limited to its depth.
789 This command is only available when tdl is being run interactively, i.e. when
790 you have a tdl prompt. It is not available directly from the shell
791 (where it wouldn't make much sense).
793 .SH Completion facilities
796 When tdl has been compiled to use the readline library, the interactive mode
797 supports a number of completion functions, activated with the <tab> key.
799 In particular, the following are supported:
801 .B Command completion.
802 If <tab> is pressed when the command line is empty, a list of possible commands
803 will be shown. If <tab> is pressed when a partial command has been typed, the
804 command will be completed immediately if possible, otherwise a list of commands
805 matching the already-typed prefix will be shown.
808 If help or usage is already in the buffer, a list of commands will be shown
809 (as above). The <tab> completion works in the same way to complete the name of
810 the command you want a help summary for.
812 .B Priority completion.
813 If list or priority is at the start of the input buffer and the current word
814 starts with a letter, tdl will try to complete the name of a priority level if
817 .B Open task completion.
818 If done is at the start of the input buffer, hitting <tab> will show a list of
819 task indices that are still open. If part of an index has already been typed,
820 the open task indices for which the typed characters are a prefix will be shown.
822 .B Postpone completion.
823 If postpone is at the start of the input buffer, hitting <tab> will show a list
824 of tasks that may be postponed. Tasks marked done are excluded. If open is at
825 the start of the input buffer, hitting <tab> will show a list of tasks that may
829 If some other command is at the start of the input buffer and <tab> is pressed,
830 tdl will show a one-line summary of that command's parameters.
832 .SH DATE SPECIFICATIONS
839 take arguments defining dates (with add and done it is optional). Dates may be
840 specified in several formats, shown by the following examples:
845 \-1h & exactly 1 hour ago
846 \-2d & exactly 2 days ago
847 +1w & exactly 1 week in the future
848 +1m & exactly 1 month (30 days) in the future
849 +2y & exactly 2 years in the future
850 \-1d\-0815 & 08:15am yesterday
851 +1d\-08 & 8am tomorrow
852 +1w\-08 & 8am on the same day as today next week
853 +6h\-08 & 8am on the day containing the time 6 hours ahead of now
856 20011020 & absolute : 12 noon on 20th October 2001
857 011020 & absolute : 12 noon on 20th October 2001 (current century)
858 1020 & absolute : 12 noon on 20th October 2001 (current century and year)
859 20 & absolute : 12 noon on 20th October 2001 (current century, year and month)
860 20011020\-081500 & absolute : 08:15am on 20th October 2001
861 20011020\-0815 & absolute : 08:15am on 20th October 2001 (seconds=0)
862 20011020\-08 & absolute : 08:00am on 20th October 2001 (minutes=seconds=0)
863 011020\-08 & absolute : 08:00am on 20th October 2001 (minutes=seconds=0, current century)
865 \-sun & 12 noon on the previous Sunday
866 +sat & 12 noon on the following Saturday
867 +sat\-08 & 8am on the following Saturday
868 \-tue\-0815 & 08:15am on the previous Tuesday
872 In the 'all-numeric' format, the rule is that dates can have fields omitted
873 from the start (assumed to be the current value), and times can have fields
874 omitted from the end (assumed to be zero, except if the hours figure is missing
875 it is assumed to be 12, since most work is done in the day.)
877 In the 'weekday and time' format, the time rule is the same: missing minutes
878 and seconds are taken as zero and missing hours as 12. If the weekday is the
879 same as today, the offset is always 7 days in the required direction. If the
880 weekday is not the same as today, the offset will always be less than 7 days in
881 the required direction.
883 In the 'relative' format, when a time is included as well, the procedure is as
884 follows. First the time is determined which is the given number of hours, days
885 etc away from the current time. Then the specified time on that day is used.
886 The main use for this is to specify times like '8am yesterday'. Obviously some
887 of the more uses of this mode are rather far-fetched.
889 For the weekday and relative formats, the sign is actually optional. The
890 default sign (implying past (-) or future (+)) will then be assumed depending on
891 the command as shown below:
897 Command & Default & Reason
899 add & + & Add entries with deferred start times
900 done & - & Entries have been completed at some time in the past
901 report & - & Reporting on earlier completed tasks not future ones
902 purge & - & Tasks won't be completed in the future, so no need to purge future ones
909 on the internet is http://www.rc0.org.uk/tdl/
912 The author is Richard P. Curnow <rc@rc0.org.uk>.
915 I got the idea from a program called devtodo. I liked what that program did
916 and the command line approach to using it, but I ran into lots of compilation
917 problems with it on older C++ installations. The path of least resistance
918 turned out to be to hack up a C program to do a similar job.
923 If this variable is set, it defines the name of the file to use for holding the
924 database of tasks. If the variable is not set, the search approach described
925 in the FILES section is used.
928 If this variable is set, the output from the
930 command is produced in monochrome instead of colour (the default).
933 ./.tdldb, ../.tdldb, ../../.tdldb, ...
934 If the TDL_DATABASE environment variable is not present, the file .tdldb in the
935 current directory is used, if that is present. If not, the same file in the
936 parent directory is used, and so on, until the root directory of the filesystem
937 is reached. If the database is still not found, a new one will be created in
938 the current directory (except for options that don't modify the database, such
939 as list, help and version.)
941 If you want to have a .tdldb file in
943 directory, the suggested approach is to set the TDL_DATABASE environment variable to "./.tdldb". So in a Bourne-like shell (sh, bash, zsh, ksh etc), you'd write
945 TDL_DATABASE=./.tdldb
949 and in a C-like shell (csh, tcsh etc) you'd write
951 setenv TDL_DATABASE ./.tdldb
953 If you want to share .tdldb files between directory hierarchies in some non-standard way, the suggested approach is to use symbolic links to do this, for example:
957 ln \-s ../project2/.tdldb .
960 Please report them to the author.
963 The full documentation for tdl is maintained as a Texinfo manual. If the info and tdl
964 programs are properly installed at your site, the command
968 should give you access to the complete manual.