@@ -58,6 +58,17 @@ type createSubCmd struct {
58
58
access string
59
59
urlname string
60
60
}
61
+ type editSubCmd struct {
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
+ }
61
72
62
73
func (sub * createSubCmd ) RegisterFlags (fl * pflag.FlagSet ) {
63
74
fl .StringVarP (& sub .access , "access" , "a" , "private" , "[private | org | authed | public] set devurl access" )
@@ -72,6 +83,9 @@ func (sub createSubCmd) Spec() cli.CommandSpec {
72
83
}
73
84
}
74
85
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.
75
89
var devURLNameValidRx = regexp .MustCompile ("^[a-zA-Z][a-zA-Z0-9]{0,63}$" )
76
90
77
91
// Run creates or updates a devURL, specified by env ID and port
@@ -208,10 +222,6 @@ func urlList(envName string) []DevURL {
208
222
flog .Fatal ("%v" , err )
209
223
}
210
224
211
- if len (devURLs ) == 0 {
212
- flog .Error ("no dev urls were found for environment: %s" , envName )
213
- }
214
-
215
225
return devURLs
216
226
}
217
227
@@ -231,6 +241,7 @@ func (cmd urlsCmd) Run(fl *pflag.FlagSet) {
231
241
func (cmd * urlsCmd ) Subcommands () []cli.Command {
232
242
return []cli.Command {
233
243
& createSubCmd {},
244
+ & editSubCmd {},
234
245
& delSubCmd {},
235
246
}
236
247
}
0 commit comments