Commit Graph

110 Commits

Author SHA1 Message Date
Ed Blackman
47c7ba75b3 Remove now-redundant export of CFG_FILE 2009-03-08 18:41:27 -04:00
Philippe Teuwen
2bd2e9f7bd Options & environment variables: add namespace & allow for preset
This patch does 2 things:
- Allowing environment variables corresponding to options (e.g. VERBOSE for -v)
to be predefined in the user environment instead of having to always use
the corresponding option.
- Adding namespace TODOTXT_ to those envvars to avoid clashes in user environment

todo.action.d scripts can call recursively todo.sh and this patch preserves
the options/envvars through the calls.
As a bonus, now the user can export in advance one of those variables in
his/her environment and it would have the same effect as using the todo.sh
corresponding option.

export TODOTXT_AUTO_ARCHIVE=0          is same as option -a
export TODOTXT_CFG_FILE=CONFIG_FILE    is same as option -d CONFIG_FILE
export TODOTXT_FORCE=1                 is same as option -f
export TODOTXT_PRESERVE_LINE_NUMBERS=0 is same as option -n
export TODOTXT_PLAIN=1                 is same as option -p
export TODOTXT_DATE_ON_ADD=1           is same as option -t
export TODOTXT_VERBOSE=1               is same as option -v

Signed-off-by: Gina Trapani <ginatrapani@gmail.com>
2009-03-09 06:28:52 +08:00
David A. Harding
7b2c9f080a Merged In Gina's Latest 2009-03-08 12:08:04 -04:00
David A. Harding
98646a575a Exit If .todo.actions.d Script Is Run
.
Suggested by Philippe Teuwen, this patch undoes a lot of the unnecessary
formating changes in my previous patch.
2009-03-08 11:46:26 -04:00
David A. Harding
e6649e6293 Removed Extended Regexes from Hiding Code
.
Dave Hein noticed the extended regular expressions (regex) in the
original patch don't work by default on Mac OS X (FreeBSD sed).  Now
using his suggested regex format: [[:space:]]@[^[:space:]]\{1,\}
.
Also changed: I misapplied part of the patch originally.  That's now
fixed.  I expanded part of the regular expression in the list
sub-expression so that I could change part of the coloring code.
2009-03-08 11:25:12 -04:00
Ed Blackman
5683490c0e Export variables so that they can be easily used in actions
Signed-off-by: Gina Trapani <ginatrapani@gmail.com>
2009-03-08 09:53:41 +08:00
David A. Harding
20e6892775 Run .todo.actions.d Before Builtins
.
Let users override default commands by creating a script in
~/.todo.actions.d/ with the same name as a default command.  Idea by Don
Harper and David A. Harding; patch by Harding.
.
The patch adds the following logic and increases the indent level for
the case statement:
.
+if [ -d "$HOME/.todo.actions.d" -a -x "$HOME/.todo.actions.d/$action" ]
+then
+    CFG_FILE="$CFG_FILE" "$HOME/.todo.actions.d/$action" "$@"
+else
+    case $action in
2009-03-07 16:15:15 -05:00
David A. Harding
fd9b002ce1 Hiding Priority, Context, and Project
.
Adds three new switches that hide priorty, context, and project text in
list output.
.
Changes proposed by Dave Hein.  Original patch by Dave Hein.  Revised
patch by David A. Harding. Thread starts at
http://tech.groups.yahoo.com/group/todotxt/message/1848
2009-03-07 13:05:40 -05:00
Philippe Teuwen
586abe8282 Cleaning indentation and mix of tabs/spaces, nothing else I swear ;-)
Signed-off-by: ginatrapani <ginatrapani@gmail.com>
2009-03-07 06:00:08 +08:00
U-STARBUCK\gina
9c6efe2ed7 Version 2.1 first commit 2009-03-05 17:26:24 -08:00