diff options
Diffstat (limited to 'internal/commands')
-rw-r--r-- | internal/commands/report.go | 60 | ||||
-rw-r--r-- | internal/commands/status_test.go | 1 |
2 files changed, 39 insertions, 22 deletions
diff --git a/internal/commands/report.go b/internal/commands/report.go index 0beb6ae..bcc0e5f 100644 --- a/internal/commands/report.go +++ b/internal/commands/report.go @@ -38,15 +38,21 @@ func NewReportInvoiceCmd() *cobra.Command { Examples: # Generate invoice for last month (default) punch report invoice -c "Acme Corp" - + # Generate invoice for last week punch report invoice -c "Acme Corp" -d "last week" - + + # Generate invoice for this month + punch report invoice -c "Acme Corp" -d "this month" + + # Generate invoice for a specific month (most recent February) + punch report invoice -c "Acme Corp" -d "february" + + # Generate invoice for month and year + punch report invoice -c "Acme Corp" -d "july 2023" + # Generate invoice for custom date range - punch report invoice -c "Acme Corp" -d "2025-06-01 to 2025-06-30" - - # Generate invoice for specific project - punch report invoice -p "Website Redesign" -d "2025-01-01 to 2025-01-31"`, + punch report invoice -c "Acme Corp" -d "2025-06-01 to 2025-06-30"`, RunE: func(cmd *cobra.Command, args []string) error { return runInvoiceCommand(cmd, args) }, @@ -54,7 +60,7 @@ Examples: cmd.Flags().StringP("client", "c", "", "Generate invoice for specific client") cmd.Flags().StringP("project", "p", "", "Generate invoice for specific project") - cmd.Flags().StringP("dates", "d", "last month", "Date range ('last week', 'last month', or 'YYYY-MM-DD to YYYY-MM-DD')") + cmd.Flags().StringP("dates", "d", "last month", "Date range ('this week', 'this month', 'last week', 'last month', month names like 'february', 'month year' like 'july 2023', or 'YYYY-MM-DD to YYYY-MM-DD')") cmd.Flags().StringP("output", "o", "", "Output file path (default: auto-generated filename)") return cmd @@ -241,15 +247,21 @@ func NewReportTimesheetCmd() *cobra.Command { Examples: # Generate timesheet for last month (default) punch report timesheet -c "Acme Corp" - + # Generate timesheet for last week punch report timesheet -c "Acme Corp" -d "last week" - + + # Generate timesheet for this month + punch report timesheet -c "Acme Corp" -d "this month" + + # Generate timesheet for a specific month (most recent February) + punch report timesheet -c "Acme Corp" -d "february" + + # Generate timesheet for month and year + punch report timesheet -c "Acme Corp" -d "july 2023" + # Generate timesheet for custom date range - punch report timesheet -c "Acme Corp" -d "2025-06-01 to 2025-06-30" - - # Generate timesheet for specific project - punch report timesheet -p "Website Redesign" -d "2025-01-01 to 2025-01-31"`, + punch report timesheet -c "Acme Corp" -d "2025-06-01 to 2025-06-30"`, RunE: func(cmd *cobra.Command, args []string) error { return runTimesheetCommand(cmd, args) }, @@ -257,7 +269,7 @@ Examples: cmd.Flags().StringP("client", "c", "", "Generate timesheet for specific client") cmd.Flags().StringP("project", "p", "", "Generate timesheet for specific project") - cmd.Flags().StringP("dates", "d", "last month", "Date range ('last week', 'last month', or 'YYYY-MM-DD to YYYY-MM-DD')") + cmd.Flags().StringP("dates", "d", "last month", "Date range ('this week', 'this month', 'last week', 'last month', month names like 'february', 'month year' like 'july 2023', or 'YYYY-MM-DD to YYYY-MM-DD')") cmd.Flags().StringP("output", "o", "", "Output file path (default: auto-generated filename)") cmd.Flags().StringP("timezone", "t", "Local", "Timezone for displaying times (e.g., 'America/New_York', 'UTC', or 'Local')") @@ -430,15 +442,21 @@ func NewReportUnifiedCmd() *cobra.Command { Examples: # Generate unified report for last month (default) punch report unified -c "Acme Corp" - + # Generate unified report for last week punch report unified -c "Acme Corp" -d "last week" - + + # Generate unified report for this month + punch report unified -c "Acme Corp" -d "this month" + + # Generate unified report for a specific month (most recent February) + punch report unified -c "Acme Corp" -d "february" + + # Generate unified report for month and year + punch report unified -c "Acme Corp" -d "july 2023" + # Generate unified report for custom date range - punch report unified -c "Acme Corp" -d "2025-06-01 to 2025-06-30" - - # Generate unified report for specific project - punch report unified -p "Website Redesign" -d "2025-01-01 to 2025-01-31"`, + punch report unified -c "Acme Corp" -d "2025-06-01 to 2025-06-30"`, RunE: func(cmd *cobra.Command, args []string) error { return runUnifiedCommand(cmd, args) }, @@ -446,7 +464,7 @@ Examples: cmd.Flags().StringP("client", "c", "", "Generate unified report for specific client") cmd.Flags().StringP("project", "p", "", "Generate unified report for specific project") - cmd.Flags().StringP("dates", "d", "last month", "Date range ('last week', 'last month', or 'YYYY-MM-DD to YYYY-MM-DD')") + cmd.Flags().StringP("dates", "d", "last month", "Date range ('this week', 'this month', 'last week', 'last month', month names like 'february', 'month year' like 'july 2023', or 'YYYY-MM-DD to YYYY-MM-DD')") cmd.Flags().StringP("output", "o", "", "Output file path (default: auto-generated filename)") cmd.Flags().StringP("timezone", "t", "Local", "Timezone for displaying times (e.g., 'America/New_York', 'UTC', or 'Local')") diff --git a/internal/commands/status_test.go b/internal/commands/status_test.go index 7244993..d7c2ac8 100644 --- a/internal/commands/status_test.go +++ b/internal/commands/status_test.go @@ -105,7 +105,6 @@ func TestStatusCommandAliases(t *testing.T) { }{ {"status command", []string{"status"}}, {"st alias", []string{"st"}}, - {"default command", []string{}}, // No subcommand should default to status } for _, tt := range tests { |