feat: add filename to exported exceltable

This commit is contained in:
Patryk Hegenberg 2025-01-03 17:14:19 +01:00
parent a6e2986143
commit b1d345b152
4 changed files with 11 additions and 8 deletions

3
cmd.go
View file

@ -55,7 +55,7 @@ func (a *App) showCommand() *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
tw := NewTimeWarrior()
if a.flags.ShowExport {
tw.ExportSummary()
tw.ExportSummary(a.flags.ExportName)
}
if a.flags.ShowWeek {
tw.ShowSummary(":week")
@ -70,6 +70,7 @@ func (a *App) showCommand() *cobra.Command {
cmd.Flags().BoolVarP(&a.flags.ShowWeek, "week", "w", false, "show timewarrior week summary")
cmd.Flags().BoolVarP(&a.flags.ShowMonth, "month", "m", false, "show timewarrior month summary")
cmd.Flags().BoolVarP(&a.flags.ShowExport, "export", "e", false, "export timewarrior timetable")
cmd.Flags().StringVarP(&a.flags.ExportName, "name", "n", "Arbeitszeiten.xlsx", "name of exported excel table")
return cmd
}