Update to use TODOTXT_DEFAULT_ACTION

Braddux
2011-08-06 19:55:36 -07:00
parent 0b8cd866e0
commit 4bde4c9fd0

@@ -12,23 +12,13 @@ alias t='todo.sh -d /path/to/your/todo.cfg'
Then you simply type @t add laundry@ from anywhere in your file tree to add a task. Then you simply type @t add laundry@ from anywhere in your file tree to add a task.
*Avoid typing todo.sh every time, a variation.* Add the following to your @~/.bashrc@ file (@~/.bash_profile@ for Mac and Cygwin users): It is possible to set the default action be setting "TODOTXT_DEFAULT_ACTION".
<pre> You can combine the above alias with the default action so that typing @t@ lists your outstanding items.
function t() {
if [ $# -eq 0 ]; then
todo.sh -d /path/to/your/todo.cfg ls
else
todo.sh -d /path/to/your/todo.cfg $*
fi
}
</pre>
Or using bash 3 or greater: *Allow @t@ to list outstanding tasks* Add the following to your @~/.bashrc@ file (@~/.bash_profile@ for Mac and Cygwin users):
<pre><code>function t() { <pre><code>export TODOTXT_DEFAULT_ACTION=ls
todo.sh -d /path/to/your/todo.cfg ${1:-"ls"} ${*#$1} alias t='todo.sh -d /path/to/your/todo.cfg'</code></pre>
}
</code></pre>
You can still type @t add laundry@ from anywhere to add a task, but now you can just type @t@ to list your current tasks. You can still type @t add laundry@ from anywhere to add a task, but now you can just type @t@ to list your current tasks.