diff --git a/internal/cli/cli.go b/internal/cli/cli.go index abcc4cd20..d8dbf244d 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -54,6 +54,8 @@ type cli struct { // 1. A tenant is found. // 2. The tenant has an access token. func (c *cli) setup(ctx context.Context) error { + cobra.EnableCommandSorting = false + if err := c.initializeAndValidateConfig(); err != nil { return err } diff --git a/internal/cli/root.go b/internal/cli/root.go index b595be7c1..fc5ffb15d 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -140,8 +140,6 @@ func addPersistentFlags(rootCmd *cobra.Command, cli *cli) { } func addSubCommands(rootCmd *cobra.Command, cli *cli) { - cobra.EnableCommandSorting = false - // The order of the commands here matters. // Add new commands in a place that reflect its // relevance or relation with other commands: