From 716759aacf74921e9a6e7e25316d117b00da7821 Mon Sep 17 00:00:00 2001 From: Garrett Delfosse Date: Fri, 8 Dec 2023 14:44:40 -0500 Subject: [PATCH] fix: provide helpful error when no login url specified (#11110) --- cli/login.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/login.go b/cli/login.go index 2727743e1b..1bf8d97297 100644 --- a/cli/login.go +++ b/cli/login.go @@ -147,6 +147,10 @@ func (r *RootCmd) login() *clibase.Cmd { rawURL = inv.Args[0] } + if rawURL == "" { + return xerrors.Errorf("no url argument provided") + } + if !strings.HasPrefix(rawURL, "http://") && !strings.HasPrefix(rawURL, "https://") { scheme := "https" if strings.HasPrefix(rawURL, "localhost") {