aboutsummaryrefslogtreecommitdiffstats
path: root/todo.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-02-04 20:58:16 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-02-04 20:58:16 +0800
commit08bfbb5ba4be9bf936c86c8cfd38cfe9835a13d4 (patch)
treeffe6a7eb015bd48b58a64659cd12a6003115ea33 /todo.go
parentbe32789ec53ebe0a2141cf4d13696280ef79ee7f (diff)
Global repo file as the default
This patch implments the new workflow mentioned in #31, in which the program still tries to find a repo file in the working directory first, and it tries the global one in the home directory if no one is found. In this patch, the condition check of the existence of the repo file is done in `todolist/file_store.go` at the very early step before the input routing.
Diffstat (limited to 'todo.go')
-rw-r--r--todo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/todo.go b/todo.go
index 2a45f28..f7d994d 100644
--- a/todo.go
+++ b/todo.go
@@ -110,6 +110,10 @@ func usage() {
func routeInput(command string, input string) {
app := todolist.NewApp()
+ if app == nil {
+ return
+ }
+
switch command {
case "l", "list", "agenda":
app.ListTodos(input)