You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd-entries.go
+24-2Lines changed: 24 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,18 @@ import (
10
10
"time"
11
11
)
12
12
13
+
var (
14
+
listTostring
15
+
listFromstring
16
+
listOrderstring
17
+
)
18
+
13
19
funcinit() {
20
+
defaultTo:=time.Now()
21
+
defaultFrom:=defaultTo.AddDate(0, 0, -7)
22
+
entriesListCommand.Flags().StringVarP(&listTo, "to", "t", defaultTo.Format("2006-01-02"), "list only entries until date (in YYYY-MM-DD format)")
23
+
entriesListCommand.Flags().StringVarP(&listFrom, "from", "f", defaultFrom.Format("2006-01-02"), "list only entries starting at date (in YYYY-MM-DD format)")
24
+
entriesListCommand.Flags().StringVarP(&listOrder, "order", "o", "asc", "list only entries starting at date (in YYYY-MM-DD format)")
14
25
entriesCommand.AddCommand(entriesListCommand)
15
26
rootCmd.AddCommand(entriesCommand)
16
27
}
@@ -26,17 +37,28 @@ var entriesListCommand = &cobra.Command{
0 commit comments