fix: enforce mandatory start/end dates and at least one identifier flag

Co-authored-by: aider (openai/qwen3-coder:30b-a3b-q4_K_M) <aider@aider.chat>
This commit is contained in:
Olivier Tremblay 2025-10-31 11:13:32 -04:00
parent b86f554261
commit f49cac59ca

View file

@ -24,8 +24,15 @@ func main() {
flag.Parse() flag.Parse()
// Check required flags // Check required flags
if *jiraUser == "" || *proj == "" || *ghusername == "" || *start == "" || *end == "" || *employeename == "" { if *start == "" || *end == "" {
fmt.Println("All flags are required") fmt.Println("Error: start and end dates are required")
flag.Usage()
os.Exit(1)
}
// Check that at least one of employee name, jira user, project, or ghusername is provided
if *employeename == "" && *jiraUser == "" && *proj == "" && *ghusername == "" {
fmt.Println("Error: at least one of employee name, jira user, project, or ghusername must be provided")
flag.Usage() flag.Usage()
os.Exit(1) os.Exit(1)
} }