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:
parent
b86f554261
commit
f49cac59ca
1 changed files with 9 additions and 2 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue