[#1012] cli: Fix messages for list commands #1013

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:fix/1012-ape_msg into master 2024-03-01 07:16:59 +00:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 303aa0b79e - Show all commits

View file

@ -69,9 +69,10 @@ func parseTarget(cmd *cobra.Command) *control.ChainTarget {
func listRules(cmd *cobra.Command, _ []string) { func listRules(cmd *cobra.Command, _ []string) {
pk := key.Get(cmd) pk := key.Get(cmd)
target := parseTarget(cmd)
req := &control.ListChainLocalOverridesRequest{ req := &control.ListChainLocalOverridesRequest{
Body: &control.ListChainLocalOverridesRequest_Body{ Body: &control.ListChainLocalOverridesRequest_Body{
Target: parseTarget(cmd), Target: target,
}, },
} }
@ -91,7 +92,7 @@ func listRules(cmd *cobra.Command, _ []string) {
chains := resp.GetBody().GetChains() chains := resp.GetBody().GetChains()
if len(chains) == 0 { if len(chains) == 0 {
cmd.Println("Local overrides are not defined for the container.") cmd.Printf("Local overrides are not defined for the %s.\n", strings.ToLower(target.GetType().String()))
return return
} }

View file

@ -58,7 +58,7 @@ func listTargets(cmd *cobra.Command, _ []string) {
targets := resp.GetBody().GetTargets() targets := resp.GetBody().GetTargets()
if len(targets) == 0 { if len(targets) == 0 {
cmd.Println("Local overrides are not defined for the container.") cmd.Println("Local overrides are not defined for any target.")
return return
} }