Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitc69c791

Browse files
author
Russtopia
authored
Merge pull request#54 from cdr/53-detect-missing-protocol
login: detect missing protocol in URL
2 parentsfe97a29 +75ff540 commitc69c791

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎cmd/coder/login.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"net"
55
"net/http"
66
"net/url"
7+
"strings"
78
"sync"
89

910
"github.com/pkg/browser"
@@ -22,13 +23,13 @@ type loginCmd struct {
2223
func (cmdloginCmd)Spec() cli.CommandSpec {
2324
return cli.CommandSpec{
2425
Name:"login",
25-
Usage:"[Coder Enterprise URL]",
26+
Usage:"[Coder Enterprise URL eg. http://my.coder.domain/]",
2627
Desc:"authenticate this client for future operations",
2728
}
2829
}
2930
func (cmdloginCmd)Run(fl*pflag.FlagSet) {
3031
rawURL:=fl.Arg(0)
31-
ifrawURL=="" {
32+
ifrawURL==""||!strings.HasPrefix(rawURL,"http"){
3233
exitUsage(fl)
3334
}
3435

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp