Skip to content

Commit

Permalink
rm aux
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Apr 13, 2024
1 parent e1a97d2 commit 97c89d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
15 changes: 1 addition & 14 deletions client/v2/autocli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion client/v2/internal/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97c89d1

Please sign in to comment.