Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 1, 2023
1 parent 983595f commit 406396f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/v2/autocli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript
cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error {
cmd.SetContext(context.WithValue(context.Background(), client.ClientContextKey, &b.ClientCtx))

if noIndent, _ := cmd.Flags().GetBool(flags.FlagNoIndent); noIndent {
encoderOptions.Indent = ""
}

clientConn, err := getClientConn(cmd)
if err != nil {
return err
Expand All @@ -130,6 +126,10 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript
return err
}

if noIndent, _ := cmd.Flags().GetBool(flags.FlagNoIndent); noIndent {
encoderOptions.Indent = ""
}

enc := encoder(aminojson.NewEncoder(encoderOptions))
bz, err := enc.Marshal(output.Interface())
if err != nil {
Expand Down

0 comments on commit 406396f

Please sign in to comment.