Skip to content

Commit

Permalink
refactor: hide --output flags that don't work (#17188)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 0b5e7ed)

# Conflicts:
#	x/auth/client/cli/tx_multisign.go
  • Loading branch information
zakir-code authored and mergify[bot] committed Jul 29, 2023
1 parent eeee766 commit 63b1890
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions x/auth/client/cli/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func GetDecodeCommand() *cobra.Command {

cmd.Flags().BoolP(flagHex, "x", false, "Treat input as hexadecimal instead of base64")
flags.AddTxFlagsToCmd(cmd)
_ = cmd.Flags().MarkHidden(flags.FlagOutput) // decoding makes sense to output only json

return cmd
}
1 change: 1 addition & 0 deletions x/auth/client/cli/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ If you supply a dash (-) argument in place of an input filename, the command rea
}

flags.AddTxFlagsToCmd(cmd)
_ = cmd.Flags().MarkHidden(flags.FlagOutput) // encoding makes sense to output only json

return cmd
}
18 changes: 12 additions & 6 deletions x/auth/client/cli/tx_multisign.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The SIGN_MODE_DIRECT sign mode is not supported.'
cmd.Flags().String(flags.FlagOutputDocument, "", "The document is written to the given file instead of STDOUT")
cmd.Flags().Bool(flagAmino, false, "Generate Amino-encoded JSON suitable for submitting to the txs REST endpoint")
flags.AddTxFlagsToCmd(cmd)
_ = cmd.Flags().MarkHidden(flags.FlagOutput)

return cmd
}
Expand Down Expand Up @@ -188,27 +189,31 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) {
}
}

<<<<<<< HEAD

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '<<'

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

expected statement, found '<<' (typecheck)

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expecting }

Check failure on line 192 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expecting }
outputDoc, _ := cmd.Flags().GetString(flags.FlagOutputDocument)

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ) at end of statement

Check failure on line 193 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ) at end of statement
if outputDoc == "" {
cmd.Printf("%s\n", json)
return
}

fp, err := os.OpenFile(outputDoc, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)
=======

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '=='

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

expected statement, found '==' (typecheck)

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ==, expecting }

Check failure on line 200 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ==, expecting }
closeFunc, err := setOutputFile(cmd)
>>>>>>> 0b5e7ed0a (refactor: hide `--output` flags that don't work (#17188))

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

'e' exponent requires decimal mantissa

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

rune literal not terminated

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

'e' exponent requires decimal mantissa

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

newline in rune literal

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

'e' exponent requires decimal mantissa

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

newline in rune literal

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

'e' exponent requires decimal mantissa

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

newline in rune literal

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

'e' exponent requires decimal mantissa

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

newline in rune literal

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

'e' exponent requires decimal mantissa

Check failure on line 202 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

newline in rune literal
if err != nil {
return err
}

defer func() {
err2 := fp.Close()
if err == nil {
err = err2
}
}()
defer closeFunc()

<<<<<<< HEAD

Check failure on line 209 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '<<'
err = clientCtx.PrintBytes(json)

return
=======

Check failure on line 213 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '=='
cmd.Printf("%s\n", json)
return nil
>>>>>>> 0b5e7ed0a (refactor: hide `--output` flags that don't work (#17188))

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '>>'

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

'e' exponent requires decimal mantissa

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / dependency-review

rune literal not terminated

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

'e' exponent requires decimal mantissa

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / golangci-lint

newline in rune literal (typecheck)

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

'e' exponent requires decimal mantissa

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (02)

newline in rune literal

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

'e' exponent requires decimal mantissa

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (03)

newline in rune literal

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

'e' exponent requires decimal mantissa

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (01)

newline in rune literal

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

'e' exponent requires decimal mantissa

Check failure on line 216 in x/auth/client/cli/tx_multisign.go

View workflow job for this annotation

GitHub Actions / tests (00)

newline in rune literal
}
}

Expand Down Expand Up @@ -243,6 +248,7 @@ The SIGN_MODE_DIRECT sign mode is not supported.'
)
cmd.Flags().String(flags.FlagOutputDocument, "", "The document is written to the given file instead of STDOUT")
flags.AddTxFlagsToCmd(cmd)
_ = cmd.Flags().MarkHidden(flags.FlagOutput) // signing makes sense to output only json

return cmd
}
Expand Down
1 change: 1 addition & 0 deletions x/genutil/client/cli/gentx.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o
cmd.Flags().String(flags.FlagOutputDocument, "", "Write the genesis transaction JSON document to the given file instead of the default location")
cmd.Flags().AddFlagSet(fsCreateValidator)
flags.AddTxFlagsToCmd(cmd)
_ = cmd.Flags().MarkHidden(flags.FlagOutput) // signing makes sense to output only json

return cmd
}
Expand Down

0 comments on commit 63b1890

Please sign in to comment.