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

Commitfa8cbf7

Browse files
author
Russtopia
committed
Added proposed edit cmd as synonym for create
Doc comment for regexRemoved error log for devURLS empty list
1 parent99468a5 commitfa8cbf7

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

‎cmd/coder/urls.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ type createSubCmd struct {
5858
accessstring
5959
urlnamestring
6060
}
61+
typeeditSubCmdstruct {
62+
createSubCmd
63+
}
64+
65+
func (sub*editSubCmd)Spec() cli.CommandSpec {
66+
return cli.CommandSpec{
67+
Name:"edit",
68+
Usage:"<env name> <port> [--access <level>] [--name <name>]",
69+
Desc:"create/update a devurl for external access",
70+
}
71+
}
6172

6273
func (sub*createSubCmd)RegisterFlags(fl*pflag.FlagSet) {
6374
fl.StringVarP(&sub.access,"access","a","private","[private | org | authed | public] set devurl access")
@@ -72,6 +83,9 @@ func (sub createSubCmd) Spec() cli.CommandSpec {
7283
}
7384
}
7485

86+
// devURLNameValidRx is the regex used to validate devurl names specified
87+
// via the --name subcommand. Named devurls must begin with a letter, and
88+
// consist solely of letters and digits, with a max length of 64 chars.
7589
vardevURLNameValidRx=regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9]{0,63}$")
7690

7791
// Run creates or updates a devURL, specified by env ID and port
@@ -208,10 +222,6 @@ func urlList(envName string) []DevURL {
208222
flog.Fatal("%v",err)
209223
}
210224

211-
iflen(devURLs)==0 {
212-
flog.Error("no dev urls were found for environment: %s",envName)
213-
}
214-
215225
returndevURLs
216226
}
217227

@@ -231,6 +241,7 @@ func (cmd urlsCmd) Run(fl *pflag.FlagSet) {
231241
func (cmd*urlsCmd)Subcommands() []cli.Command {
232242
return []cli.Command{
233243
&createSubCmd{},
244+
&editSubCmd{},
234245
&delSubCmd{},
235246
}
236247
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp