diff --git a/internal/cmd/datacenter/describe.go b/internal/cmd/datacenter/describe.go index f6cf5c8c..462525f3 100644 --- a/internal/cmd/datacenter/describe.go +++ b/internal/cmd/datacenter/describe.go @@ -61,8 +61,8 @@ var DescribeCmd = base.DescribeCmd{ slices.SortFunc(allServerTypeStatus, func(a, b *ServerTypeStatus) int { return int(a.ID - b.ID) }) + cmd.Printf("Server Types:\n") if len(allServerTypeStatus) > 0 { - cmd.Printf("Server Types:\n") for _, t := range allServerTypeStatus { cmd.Printf(" - ID: %-8d Name: %-8s Supported: %-8s Available: %s\n", t.ID, @@ -71,6 +71,8 @@ var DescribeCmd = base.DescribeCmd{ strconv.FormatBool(t.Available), ) } + } else { + cmd.Printf(" No server types\n") } return nil diff --git a/internal/cmd/datacenter/describe_test.go b/internal/cmd/datacenter/describe_test.go index ffda45b0..c8fc375e 100644 --- a/internal/cmd/datacenter/describe_test.go +++ b/internal/cmd/datacenter/describe_test.go @@ -39,6 +39,8 @@ Location: City: Latitude: 0.000000 Longitude: 0.000000 +Server Types: + No server types ` assert.NoError(t, err)