From 8b3ae5fb0ef40a321f2d5a056524b0181b2ca2c1 Mon Sep 17 00:00:00 2001 From: Cyril David Date: Fri, 22 Jan 2021 20:09:35 -0800 Subject: [PATCH] Cleanup tenant passing and getLogin helper method --- internal/cli/root.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/cli/root.go b/internal/cli/root.go index 7096c861a..ccfcd6541 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -5,15 +5,11 @@ import ( "os" "github.com/auth0/auth0-cli/internal/display" - "github.com/spf13/afero" "github.com/spf13/cobra" ) // Execute is the primary entrypoint of the CLI app. func Execute() { - // fs is a mock friendly os.File interface. - fs := afero.NewOsFs() - // cfg contains tenant related information, e.g. `travel0-dev`, // `travel0-prod`. some of its information can be sourced via: // 1. env var (e.g. AUTH0_API_KEY) @@ -28,7 +24,7 @@ func Execute() { SilenceUsage: true, SilenceErrors: true, Short: "Command-line tool to interact with Auth0.", - Long: "Command-line tool to interact with Auth0.\n" + getLogin(&fs, cli), + Long: "Command-line tool to interact with Auth0.\n" + getLogin(cli), PersistentPreRunE: func(cmd *cobra.Command, args []string) error { // If the user is trying to login, no need to go @@ -46,7 +42,7 @@ func Execute() { rootCmd.SetUsageTemplate(namespaceUsageTemplate()) rootCmd.PersistentFlags().StringVar(&cli.tenant, - "tenant", "", "Specific tenant to use.") + "tenant", cli.config.DefaultTenant, "Specific tenant to use.") rootCmd.PersistentFlags().BoolVar(&cli.verbose, "verbose", false, "Enable verbose mode.")