root/todo/trunk/doc/devtodo.1.in

Revision 290, 19.0 kB (checked in by athomas, 4 years ago)

Initial import.

Line 
1 .\" todo is licensed under the GPL, version 2. A copy of the GPL should have been distributed with the source in the file COPYING
2 .TH @PACKAGE@ "1" @VERSION@ "Alec Thomas" "Programming utility"
3 .SH "NAME"
4 .LP
5 todo \- a reminder/task program aimed at developers
6 .SH "SYNPOSIS"
7 .LP
8 .TP
9 \fBtodo [\fI<options>\fP]\fP
10 With no options, displays the items in the current directory.
11 .TP
12 \fBtda [\-p \fI<priority>\fR] [\-g \fI<index>\fP] [\fI<text>\fP]\fP
13 Add a new item, optionally grafting it as a child of the given item.
14 .TP
15 \fBtde \fI<index>\fP\fP
16 Edit the given item.
17 .TP
18 \fBtdr \fI<indices>\fP\fP
19 Remove the given items.
20 .TP
21 \fBtdd \fI<indices>\fP\fP
22 Mark the specified items as being done.
23 .TP
24 \fBtdl [\-g \fI<index>\fP] \fI<database>\fP\fP
25 Link the specified devtodo database into the current one, optionally grafting it as a child of the specified index.
26 .SH "DESCRIPTION"
27 .LP
28 \fBtodo\fP is a program aimed specifically at programmers (but usable by anybody at the terminal) to aid in day\-to\-day development.
29 .LP
30 It maintains a list of items that have yet to be completed. This allows the programmer to track outstanding bugs or items that need to be completed with very little effort.
31 .LP
32 Items can be prioritised and can also be displayed in a hierarchy, so that one item may depend on another.
33 .LP
34 With the use of some small shell scripts (scripts.* in the doc directory of the source distribution), todo can also display the outstanding items in a directory as you change into it. So, for example, if you cd into the source directory for todo itself you should see a list of outstanding items...unless all of the bugs have been fixed ;).
35 .SH "OPTIONS"
36 .LP
37 Options can have both a long and a short form.
38 .LP
39 Short options can be combined into one argument by using a hyphen followed by a string of short options. Parameters of short options can also be appended to this string.
40 .LP
41 .TP
42 \fB\-v, \-\-verbose\fR
43 Display verbosely
44 .TP
45 \fB\-a, \-\-add [\fI<text>\fR]\fR
46 Add a note (will prompt for a note if one is not supplied).
47 .TP
48 \fB\-g, \-\-graft \fI<index>\fR\fR
49 In conjunction with \fI\-\-add\fR or \fI\-\-link\fR, graft the new item to the specified item.
50 .TP
51 \fB\-l, \-\-link \fI<database>\fR\fR
52 Link the specified todo file into the body of this one. If the linked database has a title set, this will be used as the body of the linking item otherwise the directory name of the linked database will be used. Use --remove (or tdr) to remove linked databases - this does \fBnot\fR remove the database itself, only the link.
53 .TP
54 \fB\-R,\-\-reparent \fI<index>[,<index>]\fR\fR
55 Change the parent of the first item index to the second item index. If no second index is given the item is reparented to the root of the tree.
56 .TP
57 \fB\-p, \-\-priority \fI<priority>\fR\fR
58 In conjunction with \-\-add or \-\-edit, set the priority (default | veryhigh | high | medium | low | verylow)
59 .TP
60 \fB\-e, \-\-edit \fI<index>\fR\fR
61 Edit the note that is indexed by the given number.
62 .TP
63 \fB\-\-remove \fI<indices>\fR\fR
64 Remove the note indexed by the given numbers, including any children.
65 .TP
66 \fB\-d, \-\-done \fI<indices>\fR\fR
67 Mark the specified notes (and their children) as done.
68 .TP
69 \fB\-D, \-\-not\-done \fI<indices>\fR\fR
70 Mark the specified notes (and all children) as not done.
71 .TP
72 \fB\-\-global\-database \fI<file>\fR\fR
73 Specify the database to use if either the \fI-G\fR or \fI--global\fR options are specified.
74 .TP
75 \fB\-G, \-\-global\fR
76 Force todo to use the database specified with \fI--global-database\fR. If this is placed in your \fI~/.todorc\fR it will force todo to use that database to the exclusion of all others.
77 .TP
78 \fB\-\-database \fI<file>\fR\fR
79 Change the database from whatever the default is (typically '.todo') to the file specified.
80 .TP
81 \fB\-T, \-\-TODO\fR
82 Generate a typical TODO output text file from a Todo DB.
83 .TP
84 \fB\-A, \-\-all\fR
85 Shortcut for the filter '+done,+children' to show all notes.
86 .TP
87 \fB\-f, \-\-filter \fI<filter>\fR\fR
88 Display only those notes that pass the filter. Please refer the section \fIFILTERS\fR for more information.
89 .TP
90 \fB\-\-colour \fI<colours>\fR\fR
91 Override default colours of todo items. Please refer to the section \fICOLOUR\fR for more information.
92 .TP
93 \fB\-\-force\-colour\fR
94 Force use of colour even when not outputting to a TTY. This is useful when piping to \fIless(1)\fR \-R.
95 .TP
96 \fB\-\-mono\fR
97 Remove all ANSI escape sequences from output - useful for colour impaired terminals.
98 .TP
99 \fB\-\-help\fR
100 Display this help.
101 .TP
102 \fB\-\-version\fR
103 Display version of ToDo.
104 .TP
105 \fB\-\-title [\fI<text>\fR]\fR
106 Set the title of this directory's todo notes.
107 .TP
108 \fB\-\-date\-format \fI<format>\fR\fR
109 Format the display of time values. The format is that used by strftime(3). The default format is '%c'. This option is best specified in the \fI~/.todorc\fR.
110 .TP
111 \fB\-\-format \fI<identifier>=<format>\fR\fR
112 Specify the formatting of output. Please refer to the section FORMATTING for more information.
113 .TP
114 \fB\-\-use\-format \fI<builtin>=<identifier>\fR\fR
115 Use the format string identified by \fI<identifier>\fR (defined with \-\-format) as the format string to use when formatting with the builtin format \fI<builtin>\fR.
116 .TP
117 \fB\-\-sort \fI<expression>\fR\fR
118 Sort the database with the specified expression. Refer to the section \fISORTING\fR for more detailed information.
119 .TP
120 \fB\-\-paranoid\fR
121 Be paranoid about some settings, including permissions.
122 .TP
123 \fB\-\-database\-loaders \fI<loader list>\fR\fR
124 Try the database formats in the given order. Valid formats are \fIxml\fR and \fIbinary\fR. eg. todo --database-loaders binary,xml. The default format is XML.
125 .TP
126 \fB\-\-backup [\fI<n>\fR]\fR
127 Backup the database up to \fI<n>\fR times, just before it is written to. If \fI<n>\fR is not specified, one backup will be made. The filenames used to store the backups are the default database name with their revision appended like so: .todo.1, .todo.2, etc. To actually use one of these backups, you can either mv it to .todo or use --database .todo.<n> to explicitly specify its use.
128 .TP
129 \fB\-s, \-\-summary\fR
130 Toggle "summary" mode, where long items are truncated to one line.
131 .TP
132 \fB\-c, \-\-comment\fR
133 Edit or show comments respectively.
134 .TP
135 \fB\-\-timeout [\fI<time>\fR]\fR
136 If \fI<time>\fR is specified, the timeout between database displays is set to this number of seconds. If no \fI<time>\fR is specified, the behaviour is to display the database \fIonly\fR if it has not been displayed for the number of seconds specified by --timeout \fIwith\fR the \fI<time>\fR given. eg. \fItodo --timeout 10 --timeout\fR would only display the database at most once every 10 seconds. Putting a \fItimeout 10\fR in your ~/.todorc is a good option, then the --timeout in the \fIdoc/scripts.*\fR will mean that the database won't be displayed every time you cd into a directory.
137 .TP
138 \fB\-\-purge [\fI<days-old>\fR]\fR
139 Purge all completed items older than \fI<days-old>\fR. If \fI<days-old>\fR is omitted, all completed records are purged.
140 .SH "PRIORITIES"
141 .LP
142 Priorities can be specified symbolically using the words \fIdefault\fR, \fIveryhigh\fR, \fIhigh\fR, \fImedium\fR, \fIlow\fR and \fIverylow\fR.
143 .LP
144 The \fIdefault\fR priority has special meaning in that it will use the default priority for any action. This means that when editing an existing item, its priority is preserved; when creating a new item, the priority will be set to \fImedium\fR; when grafting a new item, its priority will be that of its parent. DevTodo will not prompt for priority if this is specified, making it a handy feature for your todorc. As with all options, the priority can be overridden on the command line.
145 .SH "FILTERS"
146 .LP
147 Filters are comprised of a list of expressions used to define the notes that are displayed.
148 .LP
149 The general format of a filter expression is:
150 .LP
151 \fB([-|=|+](all|children|done|<index>|<priority>)) | (/<search expression>)\fR
152 .LP
153 Generally, if a filter expression is prefixed with a '-' it will \fInot\fR display items that match the expression, if prefixed with a '+' it will display items that match this expression in addition to others, or if prefixed with a '=' (or no prefix at all) it will display \fIonly\fR those items that match the expression. Note that this will only search items not excluded by other filters, so to search the entire database you will have to do something like: \fItodo \-\-filter all,/some-search-string\fR.
154 .LP
155 The second form of filter expression is used for searching for text in a database. \fI<search expression\>\fR is a regular expression which is matched against the text body of each item.
156 .LP
157 Filter atoms are filtered in order by done state, priority, then search. So first items that do not match the "done" filter will be excluded, then those that do not match the priority filter, and so on.
158 .LP
159 The expressions in detail:
160 .TP
161 \fBall\fR
162 Forces all items to be displayed. The various prefixes have no effect on this expression.
163 .TP
164 \fBchildren\fR
165 Collapse or expand child items. If the '-' prefix is present children are collapsed, otherwise children are displayed.
166 .TP
167 \fBdone\fR
168 Filter on whether an item is completed or not.
169 .TP
170 \fB<index>\fR
171 Note indices are specified as numbers. Ranges can be given ala '1.2.10-20'.
172 .TP
173 \fB<priority>\fR
174 Priorities are specified as described in the \fIPRIORITIES\fR section. A prefix of '-' will display all items with priorities less than or equal to the given priority. With a '+' prefix, all items with priorities greater than or equal to the given priority are shown. If '=' or no prefix is given, only items with the specified priority are displayed.
175 .LP
176 Examples:
177 .LP
178 todo --filter done,-children,+low
179 .LP
180 This will display only those items that are done and have a priority of low or higher. In addition, children will be collapsed.
181 .LP
182 todo /[Tt]he
183 .LP
184 Display only those items with the word 'the' in them, where the first letter can be lower or upper case. It may be necessary to quote the search expression to ensure the shell does not interpret them.
185 .SH "FORMATTING"
186 .LP
187 The output of todo can be changed to be more to your liking by defining your own formatting strings. These strings are similar to those used in printf(3) and strftime(3).
188 .LP
189 The following examples, which can be placed in ~/.todorc, will mimic the default behaviour:
190 .LP
191 # Display in default format
192 .br
193 format display=%i%[info]%f%2n.%[priority]%T
194 .LP
195 # Display in default format
196 .br
197 format generated=%2i-%T%2i  (added %d, priority %p)\\n\\n
198 .LP
199 There are four seperate format options: \fIdisplay\fR, \fIgenerated\fR, \fIverbose\-display\fR and \fIverbose-generated\fR. The latter two are used to format their respective text when --verbose is specified as an argument to todo.
200 .LP
201 In addition, users can create their own format strings by simply passing a different identifier to \fIformat\fR. This can then be enabled by using \fI\-\-use\-format\fR. eg.
202 .LP
203 .br
204 format full-report=%i%[info]%f%2n.%[priority]%+1T%+1i%[info]Added: %[normal]%c  %[info]Completed: %[normal]%d\\n%+1i%[info]Duration: %[normal]%D  %[info]Priority: %[normal]%p\\n\\n
205 .br
206 # Override the display format to use "full-report".
207 .br
208 use-format display=full-report
209 .LP
210 The various flags that are available are:
211 .TP
212 \fB%<n>>\fR
213 The \fI>\fR flag sets the number of spaces \fI<n>\fR to use for all future indenting.
214 .TP
215 \fB%[+|-][<n>]i\fR
216 Indent to depth of current item. \fI<n>\fR specifies the depth to indent to. If \fI<n>\fR is ommitted, the current level is used. Relative values can be used. eg. '%+1T' would indent to one level higher than the current indentation level.
217 .TP
218 \fB%[+|-][<n>]T\fR
219 Display the text of the item, wrapped at 80 characters and indented to the specified level. Semantics of \fI<n>\fR are as with \fI%i\fR. Note that wrapped text automatically adds a '\n' at the end of the text, whereas \fI%t\fR will not.
220 .TP
221 \fB%t\fR
222 Unwrapped, unformatted text of the item.
223 .TP
224 \fB%s\fR
225 Summary text (ie. one line only, equivalent to \fI--summary\fR).
226 .TP
227 \fB%p\fR
228 The priority level of the current item.
229 .TP
230 \fB%c\fR
231 The current items creation date, formatted according to --date-format.
232 .TP
233 \fB%d\fR
234 The date when the item was marked as done, formatted according to --date-format.
235 .TP
236 \fB%D\fR
237 The duration of the item, formatted according to --date-format.
238 .TP
239 \fB%[<n>]n\fR
240 The index number of the current item. The optional numeric value \fI<n>\fR specifies the number of characters the number should occupy. The number is padded out with spaces so as to fill this number of characters.
241 .TP
242 \fB%f\fR
243 The state flag of the current item. The displayed values for this flag are '+' means children, '-' means done', '*' means done with children.
244 .TP
245 \fB%F\fR
246 The human readable state flag of the current item. The displayed values for this flag are 'children', 'done' means done', 'done, children' and 'open'.
247 .TP
248 \fB%[<colour>]\fR
249 Colours can be specified with this flag. The valid values for \fI<colour>\fR are: \fIverylow\fR, \fIlow\fR, \fImedium\fR, \fIhigh\fR, \fIveryhigh\fR, \fItitle\fR, \fIinfo\fR, and \fIpriority\fR. These are fairly self explanatory, except \fIpriority\fR changes to the current items priority colour. eg. %[priority]
250 .LP
251 Please note that when indenting, you will \fItypically\fR want to use a prefix value of '+1' with %T. ie. %+1T. This forces the text to indent to one level deeper than the current level, making it sit away from any other formatting you may have used.
252 .SH "SORTING"
253 .LP
254 The display of items in the database can be sorted on a variety of keys. Given a series of keys todo sorts on each successive key, continuing to the next only if the previous key comparison was equal. For example:
255 .LP
256 todo --sort -done,text
257 .LP
258 This will sort firstly by whether an item is completed and secondly by their text. This effectively groups items into two blocks \- those that are complete and those that aren't.
259 .LP
260 The keys that are available are \fIcreated\fR, \fIcompleted\fR, \fItext\fR, \fIpriority\fR, \fIduration\fR, \fInone\fR and \fIdone\fR. Each key, except \fInone\fR can be prefixed with a - to reverse its default order and multiple keys must be seperated with a ,.
261 .LP
262 If multiple --sort parameters are encountered the last one is used. This means that a 'sort' entry in ~/.todorc will be overridden by any on the command line.
263 .SH "INDICES"
264 .LP
265 Indicies are used as options to a variety of command line arguments. Multiple note indices are seperated with commas (spaces are \fInot\fR allowed). Children are scoped using a '.'.
266 .LP
267 For example, given the following notes:
268
269 1. Do man pages
270    1. Make them more beautiful.
271    2. Make HTML documentation as well.
272
273 The second sub\-item would be represented like this: 1.2
274 .LP
275 The wildcard '*' can be used to represent all children of a node. eg. 1.*
276 .LP
277 Ranges of notes can be specified by using '<a>-<b>'. For example, to mark notes 10.1.2, 10.1.3 and 10.3.4 as done, you could do: todo --done 10.1.2-4
278 .SH "COLOUR"
279 .LP
280 Various items can be colourised. Items that can are \fIveryhigh\fR, \fIhigh\fR, \fImedium\fR, \fIlow\fR, \fIverylow\fR, \fItitle\fR and \fIinfo\fR. \fIinfo\fR is used for displaying item numbers and general information.
281 .LP
282 These items can be set to one of eight colours. Those colours are \fIblack\fR, \fIred\fR, \fIgreen\fR, \fIyellow\fR, \fIblue\fR, \fImagenta\fR, \fIcyan\fR, \fIwhite\fR and \fIdefault\fR. The colour \fIdefault\fR is used to specify the default foreground terminal colour.
283 .LP
284 Colours are specified like so:
285 .LP
286 \fI<item>\fR=\fI[+]\fR\fI<colour>\fR
287 .LP
288 If the optional \fI+\fR in this expression is used it will cause the item to become bold.
289 .LP
290 For example, a line in your ~/.todorc might look like:
291 .LP
292 colour  medium=+white
293 .LP
294 Which would make \fImedium\fR text \fIbold\fR \fIwhite\fR.
295 .SH "TODORC"
296 .LP
297 todo can load options from a number of resource files. The order in which these are parsed is as follows:
298 .LP
299 1. The file specified in the environment variable \fBTODORC\fR or, if that does not exist, \fB@SYSCONFDIR@/todorc\fR.
300 .br
301 2. \fB~/.todorc\fR
302 .LP
303 Options are cumulative in that those loaded from $TODORC will be overridden or added to by those in ~/.todorc.
304 .LP
305 These options are specified as key/value pairs, one per line The key is the long name of a command line argument and the value is the parameter to that argument,if any. In addition, environment variables are expanded.
306 .LP
307 For example, the \-\-filter command line argument accepts a parameter that is a filter expression. A default filter could be added to the ~/.todorc file like so:
308 .LP
309 # Don't display child items by default
310 .br
311 filter \-children
312 .br
313 .LP
314 The only difference between options specified in the rc file and those on the command line is that options in the rc file are not prefixed by \-\-.
315 .LP
316 In addition, there are two commands available in the RC file that are not available on the command line. They are:
317 .LP
318 The first command, \fIon\fR, is used to conditionally add specific commands. The format of this command is: \fIon <event> <command> [<arguments>]\fR. Valid events are \fIadd\fR, \fIremove\fR, \fIview\fR, \fIedit\fR, \fIgenerate\fR, \fIdone\fR, \fInotdone\fR, \fItitle\fR, \fIreparent\fR, \fIload\fR, \fIsave\fR, \fIlink\fR, \fIcreate\fR and \fIpurge\fR. Multiple commands can be passed to \fIon\fR by enclosing them in braces (whitespace is required between tokens). Full example below.
319 .LP
320 The second command is \fIexec <shell command>\fR. This command will execute the argument it is given in a shell. The environment variable \fI$TODODB\fR contains the filename of the current database. eg. \fIexec chmod 600 $TODODB\fR
321 .LP
322 There is an example rc file in the doc subdirectory of the source distribution.
323 .LP
324 .SH "EXAMPLES"
325 .LP
326 To display any outstanding items in the current directory, simply type:
327 .LP
328         todo
329 .LP
330 To remove notes 1, 2 and 4:
331 .LP
332         todo \-\-remove 1,2,4
333 .LP
334 To display ALL items:
335 .LP
336         todo all
337 .LP
338 To display only the top\-level items and not their children:
339 .LP
340         todo \-children
341 .LP
342 (even though \fI\-children\fR is not a valid argument, this works because todo interprets any command line arguments it doesn't recognise as being part of a filter expression)
343 .LP
344 A more complex example. This adds a new item, with the text of the item specified on the command line, with a priority of \fIhigh\fR as a child of the third child of the second item (if that makes any sense):
345 .LP
346         todo \-a "Fix the man page" \-p high \-g 2.3
347 .LP
348 This is an example of how to use the TODO feature of todo. It makes todo generate a new TODO file from the information stored in the database. This particular example outputs all items to the TODO file, even those marked as done.
349 .LP
350         todo \-\-filter all \-\-TODO
351 .LP
352 This example shows a nice use of the event triggers. When a new database is created it will force its permissions to 0600.
353 .br
354        
355 .br
356         on create {
357 .br
358                 verbose
359 .br
360                 exec chmod 600 .todo
361 .br
362         }
363 .br
364 .SH "FILES"
365 .LP
366 .TP
367 \fB .todo\fR
368 Items are stored as XML in this file.
369 .TP
370 \fB@SYSCONFDIR@/todorc\fR
371 Default options can be specified in this file. Please refer to the section \fBTODORC\fR for more information.
372 .TP
373 \fB~/.todorc\fR
374 User-specific options are specified in this file. Please refer to the section \fBTODORC\fR for more information.
375 .SH "AUTHORS"
376 .LP
377 Alec Thomas \fI<alec@swapoff.org>\fR
378 .SH "SEE ALSO"
379 .LP
380 phpsat \fI<http://sourceforge.net/projects/phpsat>\fR
Note: See TracBrowser for help on using the browser.