aboutsummaryrefslogtreecommitdiffstats
path: root/todo.go
diff options
context:
space:
mode:
authorGrant Ammons <gammons@gmail.com>2017-03-03 17:42:27 -0500
committerGrant Ammons <gammons@gmail.com>2017-03-03 17:42:27 -0500
commitf6c9296952b062803a4991d3f97f76d61b0cc488 (patch)
treecc2e8250401f1fe37578a5b537e8f42fd454d6a3 /todo.go
parentbe32789ec53ebe0a2141cf4d13696280ef79ee7f (diff)
Add garbage collection feature
* Add `todo gc`, which will delete all archived todos. * `NextId` will now take the first available id, rather than just the MaxId + 1.
Diffstat (limited to 'todo.go')
-rw-r--r--todo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/todo.go b/todo.go
index 2a45f28..b42eed6 100644
--- a/todo.go
+++ b/todo.go
@@ -106,6 +106,10 @@ func usage() {
fmt.Println("\tDeletes a todo with id 33\n")
fmt.Println("Todolist was lovingly crafted by Grant Ammons (https://twitter.com/gammons).")
fmt.Println("For full documentation, please visit http://todolist.site")
+
+ blueBold.Println("\nGarbage Collection")
+ yellow.Println("\ttodo gc")
+ fmt.Println("\tDeletes all archived todos.\n")
}
func routeInput(command string, input string) {
@@ -131,6 +135,8 @@ func routeInput(command string, input string) {
app.EditTodoDue(input)
case "ex", "expand":
app.ExpandTodo(input)
+ case "gc":
+ app.GarbageCollect()
case "init":
app.InitializeRepo()
case "web":