Skip to content

Commit

Permalink
Merge pull request #109 from DopplerHQ/tom_login_flag
Browse files Browse the repository at this point in the history
Add yes flag to login command
  • Loading branch information
Piccirello authored Jul 12, 2020
2 parents 0d6720d + de5118f commit d81056e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var loginCmd = &cobra.Command{
scope := cmd.Flag("scope").Value.String()
prevConfig := configuration.Get(scope)
silent := utils.GetBoolFlag(cmd, "silent")
yes := utils.GetBoolFlag(cmd, "yes")
copyAuthCode := !utils.GetBoolFlag(cmd, "no-copy")
hostname, _ := os.Hostname()

Expand All @@ -65,7 +66,7 @@ var loginCmd = &cobra.Command{
}
}

openBrowser := silent || utils.ConfirmationPrompt("Open the authorization page in your browser?", true)
openBrowser := yes || silent || utils.ConfirmationPrompt("Open the authorization page in your browser?", true)
printURL := !openBrowser
if openBrowser {
if err := open.Run(authURL); err != nil {
Expand Down Expand Up @@ -207,6 +208,7 @@ This is an alias of the "logout" command.`,
func init() {
loginCmd.Flags().Bool("no-copy", false, "do not copy the auth code to the clipboard")
loginCmd.Flags().String("scope", "*", "the directory to scope your token to")
loginCmd.Flags().Bool("yes", false, "open browser without confirmation")

loginRollCmd.Flags().String("scope", "*", "the directory to scope your token to")
loginRollCmd.Flags().Bool("no-update-config", false, "do not update the rolled token in the config file")
Expand Down

0 comments on commit d81056e

Please sign in to comment.