Set ls As the Default Action

.
Suggested by mbrubeck
This commit is contained in:
David A. Harding
2009-03-11 17:42:15 -04:00
parent 717f052f13
commit 87959a8aa8

View File

@@ -162,6 +162,7 @@ help()
TODOTXT_PLAIN=1 is same as option -p
TODOTXT_DATE_ON_ADD=1 is same as option -t
TODOTXT_VERBOSE=1 is same as option -v
TODOTXT_DEFAULT_ACTION="ls" default action
EndHelp
if [ -d "$HOME/.todo.actions.d" ]
@@ -319,7 +320,12 @@ export TODO_SH
. "$TODOTXT_CFG_FILE"
[ -z "$1" ] && usage
## Run the default action if no action called on command line
if [ -z "$1" ]
then
exec $0 ${TODOTXT_DEFAULT_ACTION:-ls}
fi
[ -d "$TODO_DIR" ] || die "Fatal Error: $TODO_DIR is not a directory"
cd "$TODO_DIR" || die "Fatal Error: Unable to cd to $TODO_DIR"