{"record":{"id":"ecc1537a49715bf0","repo":"go-task/task","slug":"task-you-can-t-set-output-group-end-without-o","errorCode":null,"errorMessage":"task: You can't set --output-group-end without --output=group","messagePattern":"task: You can't set --output-group-end without --output=group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/flags/flags.go","lineNumber":221,"sourceCode":"func Validate() error {\n\tif Download && Offline {\n\t\treturn errors.New(\"task: You can't set both --download and --offline flags\")\n\t}\n\n\tif Download && ClearCache {\n\t\treturn errors.New(\"task: You can't set both --download and --clear-cache flags\")\n\t}\n\n\tif Global && Dir != \"\" {\n\t\treturn errors.New(\"task: You can't set both --global and --dir\")\n\t}\n\n\tif Output.Name != \"group\" {\n\t\tif Output.Group.Begin != \"\" {\n\t\t\treturn errors.New(\"task: You can't set --output-group-begin without --output=group\")\n\t\t}\n\t\tif Output.Group.End != \"\" {\n\t\t\treturn errors.New(\"task: You can't set --output-group-end without --output=group\")\n\t\t}\n\t\tif Output.Group.ErrorOnly {\n\t\t\treturn errors.New(\"task: You can't set --output-group-error-only without --output=group\")\n\t\t}\n\t}\n\n\tif List && ListAll {\n\t\treturn errors.New(\"task: cannot use --list and --list-all at the same time\")\n\t}\n\n\tif ListJson && !List && !ListAll {\n\t\treturn errors.New(\"task: --json only applies to --list or --list-all\")\n\t}\n\n\tif NoStatus && !ListJson {\n\t\treturn errors.New(\"task: --no-status only applies to --json with --list or --list-all\")\n\t}\n","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/internal/flags/flags.go#L203-L239","documentation":"Flag validation error raised by the Validate function after CLI parsing before task execution. It fires when --output-group-end (end marker for grouped output) is given while the output mode is not 'group', making the marker meaningless. Fix by adding --output=group or removing --output-group-end.","triggerScenarios":"Running `task --output-group-end <str>` without `--output=group`, i.e. Output.Group.End is non-empty while Output.Name != \"group\".","commonSituations":"Copy-pasted command lines where the --output=group part was dropped; scripts exporting group-output env vars globally for all task invocations.","solutions":["Add `--output=group` to the command","Remove --output-group-end if group output is not wanted","Audit scripts/env for a globally exported group-end value"],"exampleFix":"# before\ntask --output interleaved --output-group-end \"=== END\"\n\n# after\ntask --output group --output-group-end \"=== END\"","handlingStrategy":"validation","validationCode":"if flags.Output.Name != \"group\" && flags.Output.Group.End != \"\" {\n\treturn errors.New(\"--output-group-end requires --output=group\")\n}","typeGuard":null,"tryCatchPattern":"if err := flags.Validate(); err != nil {\n\tif strings.Contains(err.Error(), \"--output-group-end\") {\n\t\tfmt.Fprintln(os.Stderr, \"add --output=group or drop --output-group-end\")\n\t\tos.Exit(2)\n\t}\n\treturn err\n}","preventionTips":["Only pass --output-group-end when output style is group","Keep group markers next to the --output=group flag in scripts","Audit global env exports for output-related variables"],"tags":["cli","flags","output","go-task"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"385e5ad92af02877b6d7cf9dcc963b5ed916e70a","analyzedAt":"2026-09-05T09:01:05.226Z","contentChangedAt":"2026-09-05T09:01:05.226Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}