[#1147] cli: Fix output when print EC info with flags json & proto

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-05-27 21:31:59 +03:00
parent 4c943eb00d
commit 8f9f20698b

View file

@ -152,7 +152,11 @@ func printECInfoErr(cmd *cobra.Command, err error) bool {
ok := errors.As(err, &errECInfo)
if ok {
cmd.PrintErrln("Object is erasure-encoded, ec information received.")
toJSON, _ := cmd.Flags().GetBool(commonflags.JSON)
toProto, _ := cmd.Flags().GetBool("proto")
if !(toJSON || toProto) {
cmd.PrintErrln("Object is erasure-encoded, ec information received.")
}
printECInfo(cmd, errECInfo.ECInfo())
}