go-task/task · error
task: You can't set --output-group-error-only without --outp
Error message
task: You can't set --output-group-error-only without --output=group
What it means
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.
Source
Thrown at internal/flags/flags.go:224
}
if Download && ClearCache {
return errors.New("task: You can't set both --download and --clear-cache flags")
}
if Global && Dir != "" {
return errors.New("task: You can't set both --global and --dir")
}
if Output.Name != "group" {
if Output.Group.Begin != "" {
return errors.New("task: You can't set --output-group-begin without --output=group")
}
if Output.Group.End != "" {
return errors.New("task: You can't set --output-group-end without --output=group")
}
if Output.Group.ErrorOnly {
return errors.New("task: You can't set --output-group-error-only without --output=group")
}
}
if List && ListAll {
return errors.New("task: cannot use --list and --list-all at the same time")
}
if ListJson && !List && !ListAll {
return errors.New("task: --json only applies to --list or --list-all")
}
if NoStatus && !ListJson {
return errors.New("task: --no-status only applies to --json with --list or --list-all")
}
if Nested && !ListJson {
return errors.New("task: --nested only applies to --json with --list or --list-all")
}View on GitHub (pinned to 385e5ad92a)
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
Example fix
# before task --output-group-error-only # after task --output group --output-group-error-only
Defensive patterns
Strategy: validation
Validate before calling
if flags.Output.Name != "group" && flags.Output.Group.ErrorOnly {
return errors.New("--output-group-error-only requires --output=group")
} Try / catch
if err := flags.Validate(); err != nil {
if strings.Contains(err.Error(), "--output-group-error-only") {
fmt.Fprintln(os.Stderr, "add --output=group or drop --output-group-error-only")
os.Exit(2)
}
return err
} Prevention
- 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
When it happens
Trigger: Running `task --output-group-error-only` without `--output=group`, i.e. Output.Group.ErrorOnly is true while Output.Name != "group".
Common situations: 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.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- task: You can't set --output-group-begin without --output=gr
- task: You can't set --output-group-end without --output=grou
- task: You can't set both --download and --offline flags
- task: You can't set both --download and --clear-cache flags
- task: You can't set both --global and --dir
AI-assisted analysis of go-task/task@385e5ad92a (2026-09-05).
Data as JSON: /api/errors/11e332c83fe80edf.
Report an issue: GitHub.