From 782bd5956a3cb9b0cadd1da7ddc8cfb493bd3ceb Mon Sep 17 00:00:00 2001 From: Kevin Schoon Date: Sun, 21 Jan 2018 01:24:48 +0800 Subject: [PATCH] assending tasks by default --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 22e0d0c..48c1ea9 100644 --- a/main.go +++ b/main.go @@ -50,9 +50,9 @@ func list(path *string) func(*cli.Cmd) { return func(cmd *cli.Cmd) { cmd.Spec = "[OPTIONS]" var ( - asJSON = cmd.BoolOpt("json", false, "output task history as JSON") - reverse = cmd.BoolOpt("r reverse", false, "sort tasks assending in age") - limit = cmd.IntOpt("n limit", 0, "limit the number of results by n") + asJSON = cmd.BoolOpt("json", false, "output task history as JSON") + assend = cmd.BoolOpt("assend", true, "sort tasks assending in age") + limit = cmd.IntOpt("n limit", 0, "limit the number of results by n") ) cmd.Action = func() { db, err := NewStore(*path) @@ -60,7 +60,7 @@ func list(path *string) func(*cli.Cmd) { defer db.Close() tasks, err := db.ReadTasks() maybe(err) - if *reverse { + if *assend { sort.Sort(sort.Reverse(ByID(tasks))) } if *limit > 0 && (len(tasks) > *limit) {