Adapting --range: lowercase switch and better messages

This commit is contained in:
Martin (Schretzi) Fuchsluger
2025-02-16 08:18:14 +01:00
parent 6b6e4e5ce6
commit beef2d767e
3 changed files with 20 additions and 8 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package z
import (
"fmt"
"strings"
"github.com/shopspring/decimal"
"github.com/spf13/cobra"
@@ -38,7 +39,7 @@ func init() {
rootCmd.AddCommand(listCmd)
listCmd.Flags().StringVar(&since, "since", "", "Date/time to start the list from")
listCmd.Flags().StringVar(&until, "until", "", "Date/time to list until")
listCmd.Flags().StringVar(&listRange, "range", "", "shortcut to set since/until for a given range (today, yesterday, thisWeek, lastWeek, thisMonth, lastMonth)")
listCmd.Flags().StringVar(&listRange, "range", "", "Shortcut for --since and --until that accepts: " + strings.Join(Ranges(), ", "))
listCmd.Flags().StringVarP(&project, "project", "p", "", "Project to be listed")
listCmd.Flags().StringVarP(&task, "task", "t", "", "Task to be listed")
listCmd.Flags().BoolVar(&fractional, "decimal", false, "Show fractional hours in decimal format instead of minutes")