diff --git a/command/catalog_list_services.go b/command/catalog_list_services.go index cfd76923f..427b65566 100644 --- a/command/catalog_list_services.go +++ b/command/catalog_list_services.go @@ -123,6 +123,7 @@ func (c *CatalogListServicesCommand) Run(args []string) int { var b bytes.Buffer tw := tabwriter.NewWriter(&b, 0, 2, 6, ' ', 0) for _, s := range order { + sort.Strings(services[s]) fmt.Fprintf(tw, "%s\t%s\n", s, strings.Join(services[s], ",")) } if err := tw.Flush(); err != nil { diff --git a/command/catalog_list_services_test.go b/command/catalog_list_services_test.go index 4e6be7c62..23eca94b2 100644 --- a/command/catalog_list_services_test.go +++ b/command/catalog_list_services_test.go @@ -102,7 +102,7 @@ func TestCatalogListServicesCommand_Run(t *testing.T) { } output := ui.OutputWriter.String() - if expected := "foo,bar"; !strings.Contains(output, expected) { + if expected := "bar,foo"; !strings.Contains(output, expected) { t.Errorf("expected %q to contain %q", output, expected) } })