From 97c89d1760511e12b8478949823b4d7dd4e64f2c Mon Sep 17 00:00:00 2001 From: mmsqe Date: Sat, 13 Apr 2024 21:08:50 +0800 Subject: [PATCH] rm aux --- client/v2/autocli/common.go | 15 +-------------- client/v2/internal/flags/flags.go | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/client/v2/autocli/common.go b/client/v2/autocli/common.go index 3deb72714eda..8ec112229ebd 100644 --- a/client/v2/autocli/common.go +++ b/client/v2/autocli/common.go @@ -226,29 +226,16 @@ func enhanceCustomCmd(builder *Builder, cmd *cobra.Command, cmdType cmdType, mod // outOrStdoutFormat formats the output based on the output flag and writes it to the command's output stream. func (b *Builder) outOrStdoutFormat(cmd *cobra.Command, out []byte) error { - var clientCtx client.Context + clientCtx := client.Context{} if v := cmd.Context().Value(client.ClientContextKey); v != nil { clientCtx = *(v.(*client.Context)) - } else { - clientCtx = client.Context{} } - flagSet := cmd.Flags() if clientCtx.OutputFormat == "" || flagSet.Changed(flags.FlagOutput) { output, _ := flagSet.GetString(flags.FlagOutput) clientCtx = clientCtx.WithOutputFormat(output) } - if !clientCtx.IsAux || flagSet.Changed(flags.FlagAux) { - isAux, _ := flagSet.GetBool(flags.FlagAux) - if isAux { - // If the user didn't explicitly set an --output flag, use JSON by default. - if clientCtx.OutputFormat == "" || !flagSet.Changed(flags.FlagOutput) { - clientCtx = clientCtx.WithOutputFormat(flags.OutputFormatJSON) - } - } - } - var err error outputType := clientCtx.OutputFormat // if the output type is text, convert the json to yaml diff --git a/client/v2/internal/flags/flags.go b/client/v2/internal/flags/flags.go index 3a1f0772815e..d06cef708cad 100644 --- a/client/v2/internal/flags/flags.go +++ b/client/v2/internal/flags/flags.go @@ -17,7 +17,6 @@ const ( // FlagNoProposal is the flag convert a gov proposal command into a normal command. // This is used to allow user of chains with custom authority to not use gov submit proposals for usual proposal commands. FlagNoProposal = "no-proposal" - FlagAux = "aux" ) // List of supported output formats