[#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 committed by Evgenii Stratonikov
parent a82c8cc5b8
commit 88b8ddd902

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())
}