Skip to content

Commit 6509845

Browse files
committed
show progress generating diff table
1 parent 20eeeee commit 6509845

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/diff.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ var diffCmd = &cobra.Command{
7777
return nil
7878
},
7979
Run: func(cmd *cobra.Command, args []string) {
80+
spinner := newSpinner()
81+
defer spinner.Stop()
82+
spinner.Start()
8083
config := config.NewConfig()
8184

8285
tmetricUserMe := tmetric.NewUser()
@@ -130,6 +133,9 @@ var diffCmd = &cobra.Command{
130133

131134
totalTimeDiff := 0
132135
for currentDay := start; !currentDay.After(end); currentDay = currentDay.AddDate(0, 0, 1) {
136+
spinner.Stop()
137+
spinner.Suffix = fmt.Sprintf(" %s", currentDay.Format("2006-01-02"))
138+
spinner.Start()
133139
row := tableRow{}
134140
row.Date = currentDay.Format("2006-01-02")
135141
sumDurationTmetric := 0
@@ -223,6 +229,7 @@ var diffCmd = &cobra.Command{
223229
})
224230
outputTable.AppendSeparator()
225231
}
232+
spinner.Stop()
226233
outputTable.AppendRow(table.Row{
227234
"",
228235
"",

0 commit comments

Comments
 (0)