diff --git a/cmd/login.go b/cmd/login.go index d87dbf0..432e371 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -15,13 +15,14 @@ and usage of using your command. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { noLocalhostFlag, _ := cmd.Flags().GetBool("no-localhost") if noLocalhostFlag { - oauth.LoginWithoutLocalhost() + return oauth.LoginWithoutLocalhost() } else { oauth.LoginWithLocalhost() } + return nil }, }