Skip to content

Commit

Permalink
Merge pull request #3625 from ActiveState/mitchell/dx-3176
Browse files Browse the repository at this point in the history
Turn on non-interactive mode for structured output.
  • Loading branch information
mitchell-as authored Dec 27, 2024
2 parents 1315735 + 65599ef commit c210e20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/state/internal/cmdtree/cmdtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,12 @@ func newStateCommand(globals *globalOptions, prime *primer.Values) *captain.Comm
Shorthand: "o",
Description: locale.T("flag_state_output_description"),
Persist: true,
Value: &globals.Output,
OnUse: func() {
if prime.Output().Type().IsStructured() {
globals.NonInteractive = true
}
},
Value: &globals.Output,
},
{
Name: "non-interactive", // Name and Shorthand should be kept in sync with cmd/state/output.go
Expand Down

0 comments on commit c210e20

Please sign in to comment.