Skip to content

Commit

Permalink
Set ls As the Default Action
Browse files Browse the repository at this point in the history
.
Suggested by mbrubeck
  • Loading branch information
harding committed Mar 11, 2009
1 parent 717f052 commit 87959a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion todo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down Expand Up @@ -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"

Expand Down

0 comments on commit 87959a8

Please sign in to comment.