Skip to content

Commit

Permalink
Cleanup tenant passing and getLogin helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Jan 23, 2021
1 parent 1e56c8b commit 8b3ae5f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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.")
Expand Down

0 comments on commit 8b3ae5f

Please sign in to comment.