From e467cbbfa257730d1827d3cf29d0c36ebacd0630 Mon Sep 17 00:00:00 2001 From: Hugo Vieira Date: Wed, 15 Mar 2023 15:25:03 +0000 Subject: [PATCH] feat(cmd): Display plugin host external name if present --- internal/cmd/commands/hostscmd/funcs.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/cmd/commands/hostscmd/funcs.go b/internal/cmd/commands/hostscmd/funcs.go index ebcaeca069..4908d2288b 100644 --- a/internal/cmd/commands/hostscmd/funcs.go +++ b/internal/cmd/commands/hostscmd/funcs.go @@ -85,6 +85,11 @@ func (c *Command) printListTable(items []*hosts.Host) string { fmt.Sprintf(" External ID: %s", item.ExternalId), ) } + if item.ExternalName != "" { + output = append(output, + fmt.Sprintf(" External Name: %s", item.ExternalName), + ) + } if item.Version > 0 { output = append(output, fmt.Sprintf(" Version: %d", item.Version), @@ -145,6 +150,9 @@ func printItemTable(item *hosts.Host, resp *api.Response) string { if item.ExternalId != "" { nonAttributeMap["External ID"] = item.ExternalId } + if item.ExternalName != "" { + nonAttributeMap["External Name"] = item.ExternalName + } maxLength := base.MaxAttributesLength(nonAttributeMap, item.Attributes, keySubstMap)