We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3d5649 commit d31c29bCopy full SHA for d31c29b
1 file changed
internal/commands/root.go
@@ -196,13 +196,11 @@ func Execute() {
196
197
// jq-related errors (validation failures, unsupported commands, conflicts)
198
// must never be fed through the jq filter. Rebuild the output writer
199
- // without jq so the error renders cleanly.
+ // without jq so the error renders cleanly. Re-resolve the format to
200
+ // honor explicit flags like --agent --json.
201
if errors.IsJQError(err) && cfgJQ != "" {
- format := output.FormatJSON // --jq implies --json
202
- if cfgAgent || cfgQuiet {
203
- format = output.FormatQuiet
204
- }
205
- out = output.New(output.Options{Format: format, Writer: os.Stdout})
+ format, _ := resolveFormat()
+ out = output.New(output.Options{Format: format, Writer: outWriter})
206
}
207
208
_ = out.Err(e)
0 commit comments