Skip to content

Commit f01755c

Browse files
committed
allow to set date in the export
1 parent e65909a commit f01755c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cmd/export.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ var exportCmd = &cobra.Command{
5959
"ArbitraryString": func(i int) string {
6060
return arbitraryString[i]
6161
},
62+
"ExportDate": func() string {
63+
return exportDate
64+
},
6265
"DetailedReport": func(clientName string, tagName string, groupName string) tmetric.Report {
6366
report, err := tmetric.GetDetailedReport(
6467
config, tmetricUser, clientName, tagName, groupName, startDate, endDate, projects,
@@ -131,6 +134,9 @@ func init() {
131134
exportCmd.Flags().StringVarP(&startDate, "start", "s", firstDayOfMonth, "start date")
132135
today := time.Now().Format("2006-01-02")
133136
exportCmd.Flags().StringVarP(&endDate, "end", "e", today, "end date")
137+
exportCmd.Flags().StringVarP(
138+
&exportDate, "date", "d", today, "date entry to be used in the export",
139+
)
134140
exportCmd.Flags().StringArrayVarP(
135141
&arbitraryString,
136142
"arbitraryString",

cmd/root.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ package cmd
1919

2020
import (
2121
"fmt"
22-
"github.com/briandowns/spinner"
2322
"os"
2423
"time"
2524

25+
"github.com/briandowns/spinner"
26+
2627
"github.com/spf13/cobra"
2728
"github.com/spf13/viper"
2829
)
2930

3031
var cfgFile string
3132
var startDate string
3233
var endDate string
34+
var exportDate string
3335

3436
// rootCmd represents the base command when called without any subcommands
3537
var rootCmd = &cobra.Command{

0 commit comments

Comments
 (0)