{"record":{"id":"11e332c83fe80edf","repo":"go-task/task","slug":"task-you-can-t-set-output-group-error-only-with","errorCode":null,"errorMessage":"task: You can't set --output-group-error-only without --output=group","messagePattern":"task: You can't set --output-group-error-only without --output=group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/flags/flags.go","lineNumber":224,"sourceCode":"\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\n\tif Nested && !ListJson {\n\t\treturn errors.New(\"task: --nested only applies to --json with --list or --list-all\")\n\t}","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/internal/flags/flags.go#L206-L242","documentation":"Flag validation error raised by the Validate function after CLI parsing before task execution. It fires when --output-group-error-only (suppress non-error output, show only failing task output) is set without --output=group, since this option only applies in group output mode. Fix by adding --output=group or removing --output-group-error-only.","triggerScenarios":"Running `task --output-group-error-only` without `--output=group`, i.e. Output.Group.ErrorOnly is true while Output.Name != \"group\".","commonSituations":"CI scripts enabling error-only output for quieter logs but forgetting the group style; combining the flag with a default or prefixed output set elsewhere in a Taskfile/config.","solutions":["Add `--output=group` to the invocation","Remove --output-group-error-only if you don't use group output","Check Taskfile/config that may set output style independently of CLI flags"],"exampleFix":"# before\ntask --output-group-error-only\n\n# after\ntask --output group --output-group-error-only","handlingStrategy":"validation","validationCode":"if flags.Output.Name != \"group\" && flags.Output.Group.ErrorOnly {\n\treturn errors.New(\"--output-group-error-only requires --output=group\")\n}","typeGuard":null,"tryCatchPattern":"if err := flags.Validate(); err != nil {\n\tif strings.Contains(err.Error(), \"--output-group-error-only\") {\n\t\tfmt.Fprintln(os.Stderr, \"add --output=group or drop --output-group-error-only\")\n\t\tos.Exit(2)\n\t}\n\treturn err\n}","preventionTips":["Pair --output-group-error-only with --output=group","In CI, set the whole quiet-output flag set together, not piecemeal","Verify the Taskfile's output setting doesn't clash with CLI modifiers"],"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"}