tofu(1)

TOFU(1) TOFU(1)

NAME

tofu - plain (stupid) text-based todo(s) manager.

SYNOPSIS

tofu [[selectors] [actions] [[selectors] [actions]] ...]

DESCRIPTION

tofu provides an easy and efficient way to manage your todo list(s). It is primarily dedicated to (command-line addicted) developers, but should be convenient for other usages (administration, documentation, and so on).

All the tasks you manage through tofu are stored in a single list. The level of priority of each one is represented by its position in the list, the highest being the most important. You can then use tags to categorize theses ones and/or associate to thems a plain text content which stores any information useful in order to achieve each one. It is also possible to manage several todo lists by using the sub-queueing mechanism which allows to focus only on a precise set of tasks.

The tofu command distinguishes two kinds of arguments: the selectors and the actions. A cycle is composed of a selection specified by one or more selectors followed by one or more actions. The selection is first collected, then the actions are applied each one after the other on it. It is therefore possible to specify several cycles on one line just by alternating selections and actions. If no selection is specified, then all the tasks in the current queue are called, if no action is given, then the default digest one is applied.

OPTIONS

Here are descripted the selectors and the actions acknowledged by tofu. A list is a suite of words separated by a comma or a space. On the opposite, a string indicate that a solid suite of characters is expected, while n stands for any integer number.

Selectors

n
select the task n explicitely. These selectors have an highter priority than almost all of the others. So, even a task selected by this way but excluded by another selector will be kept in the selection. The only exceptions to this are the explicit deselectors, and max (which will just try to keep them as much as possible).

Note this selector, as long as the queue is not changed always refers to the position of the task before any operation is made on. This means that for example "5" will always select the same task in a further cycle, even if its position was modified in a precedent one.

-n
select all the tasks in the current queue but the n one. A task deselected by this way will never be kept in the selection, even with an explicit selector.

Note that, like n, this selector always refers to the position of the task in the current queue before any operation is made on.

all
call all the tasks that are not excluded by another selector in the selection. This is primarily useful to insert a cycle which applies to the whole current queue.
max=n
limit the selection to n tasks maximum. This selector have an highter priority than all the others and will be applied even when you have more than n tasks explicitely selected (see the n selector, above).
next=string
call in the selection the next task to come. This selector allows to add a new task in the current queue and is considered as an explicite calling (see the n selector, above).
queue=string
change the current queue to be the one composed of all of the tasks tagged with string. This selector is special as it is always applied before the others and it is trans-cycle: once in a queue, every further commands apply to it.

Use the main string to match the entire todo list.

wi=list
select only the tasks that bear at least one of the tags in the given list.
wil=list
select only the tasks that bear all of the tags in the given list.
wo=list
exclude from the selection the tasks that bear at least one of the tags in the given list.
wol=list
exclude from the selection the tasks that bear all of the tags in the given list.

When several selectors are mixed, tofu always return the selection the more restrictive it can define.

Actions

clean
erase all of the tags set on the selected tasks.
color=n
color the tasks with the given color which is designed by a number between 0 and 8. The result can be different according to the configuration of your terminal, here are described the defaults with their respectively attached tofu specification/ANSI escape sequence between parenthesis: default color (0/\e[0;0m), default bold color (1/\e[0;1m), black (2/\e[0;30m), red (3/\e[0;31m), green (4/\e[0;32m), yellow (5/\e[0;33m), blue (6/\e[0;34m), magenta (7/\e[0;35m) and cyan (8/\e[0;36m).
delete
remove the selected tasks from the todo. For each one, you will be asked to confirm that you want to remove it. You can answer by entering y(es) or n(o). If you give an upper-cased answer (ie. Y or N), your choice will be validated for all of the following tasks. You can also read the content of the task before deciding to remove it by entering r(ead).
digest
print a digest of each selected task, showing its position and the tags set on it.
dump
print a dump of the selection, printing position, tags and title of each one, separated by a tabulation. This is primarily useful to make scripts that work on tofu output.
edit
edit the content of the selected tasks with the editor specified in the configuration (further informations in the Parameters section).
erase=list
erase the specified tag(s) put on the selected tasks.
help
print the help digest on the standard output, then exit.
jump=n
pack the selection and insert it at the position n in the current queue.
list
print a compact list of the selected tasks, just showing their position and header.
read
print the content of each selected task.
ride=n
pack the selection and insert it before the current nth task. The target here is the task, not its position. This means the selection will follow it, even it a previous cycle changed its position in the queue. If the chosen task is deleted or not in the current queue, nothing happens.
stamp=list
add the given tag(s) on the selected tasks.

CONFIGURATION

The initial behaviour of tofu can be altered and extended by creating and feeding the ~/.tofurc file.

There are two kinds of definitions that can be stored into it: the paramaters and the macros. Each one has its dedicated syntax.

You can also add comments by beginning the lines of it with a #.

Parameters

The parameters aim to change the default behaviour of tofu They are specified on a single line under the definition = value form. A string is any arbitrary suite of character taken as is, a boolean considers any value different from 0 (typically 1) as true and 0 as false, and n means that a positive integer is expected.

charset = string
specify the character set locally used. This is automatically done if the locale stored in your LANG environment indicates it (e. g. "fr_FR.utf8" let tofu know the used character set is UTF-8). The given string can be any character set supported by your perl interpretor (see Encode(3) for further information), unknown encoding are silently ignored.

It is of course always better to let perl know the charset to use, but it also has some cost regarding to the execution speed. So, if you use a "byte-oriented" character set (ie. 256 characters coded on 8bits, like all of the iso-8859-* named sets), it may be a reasonable choice to let perl on its own for this operation and to specify the special none word here, which explicitly disables any character set support.

editor = string
specify the command to use to edit the content of the tasks. The default command is the one specified through the EDITOR environment variable or vi.
global-edition = boolean
when several tasks are selected for edition, give all of the content files to the editor command at once instead of one after the other. The default value is false.
mono-cycle = boolean
agregate the command line into one selection and one action set instead of splitting it in several cycles.
recursive-macro-max = n
macros (see the Macros sub-section, bellow) can contain other macros that call themselves other ones. This parameter specifies the deepest level this behaviour can be followed. The default level is 100.
reset-to-main = boolean
per default, tofu records the name of the last selected queue and applies further operations to it. If you want the current queue to be reset to the main one after each execution, set this parameter to true.
use-color = boolean
when set to true, allows to use colors in the output displayed. The default value is true.

Macros

The macros are commands defined by the user using the main selectors/actions of tofu or/and other macros. These ones can be specified on several lines under the macro(commands) form and are called on the command line through the :macro syntax. When used, the content of the macro is resolved and its content replaces it.

Each member of a macro definition must be separated from the others with a comma, so the members of lists passed as arguments must use a space as separator. A macro can expect arguments or not, it is the case when a command inside is specified with an empty argument which will be fed with the one of the macro. Here are some examples of macro definitions:

# A simple macro (":foo")
foo(wi=one two, wol=three four)
# A macro with arguments (":bar=<arg>")
bar(all, erase=, digest)
# A macro using the others
baz(:foo, wi=five six, :bar=seven)

ENVIRONMENT

Bellow are the environment variables handled by tofu:

EDITOR
specify the command to use to edit the task contents. The default is vi.
TOFUDIR
indicate the directory where the todo is stored. The default is ~/.tofu. This directory should be created first.
TOFURC
indicate the file where the configuration of tofu is stored. The default is ~/.tofurc.

SEE ALSO

tofuup(1), tofututo(7)

AUTHOR

tofu and this manual were written and are maintained by Sébastien Boillod. Bug/typo reports, patches, suggestions, feedbacks and so on are welcome at <sbb at tuxfamily dot org>.

tofu and this manual are published under the terms of the very permissive MIT/X11 license. The text of this one is reproduced at the head of the script.

05 February 2011 tofu-3.2