@@ -283,34 +283,32 @@ func AppAttachDomain(appName, domainName, path, endpoint string) (*ybApi.AppStat
283283
284284func appAttachDomain (cmd * cobra.Command , args []string ) {
285285 var (
286- app = cmd . Flag ( "application" ). Value . String ( )
287- dom = cmd . Flag ( "domain" ). Value . String ( )
288- path = cmd . Flag ( "path" ). Value . String ( )
289- ep = cmd . Flag ( "endpoint" ). Value . String ( )
286+ app = forceFlagGetStrValue ( cmd , "application" , "Enter Application Name:" )
287+ dom = forceFlagGetStrValue ( cmd , "domain" , "Enter Domain:" )
288+ path = forceFlagGetStrValue ( cmd , "path" , "Enter Path:" )
289+ ep = forceFlagGetStrValue ( cmd , "endpoint" , "Enter Endpoint [ format: 8080/http ]:" )
290290 )
291291
292- if app == "" {
293- app = readFromConsole ("Enter Application Name:" )
294- }
295- if dom == "" {
296- dom = readFromConsole ("Enter Domain:" )
297- }
298- if path == "" {
299- dom = readFromConsole ("Enter Path:" )
300- }
301-
302292 res , err := AppAttachDomain (app , dom , path , ep )
303293
304294 uiCheckErr ("Could not Attach the Domain for Application" , err )
305295 uiApplicationStatus (res )
306296}
307297
308298func appDetachDomain (cmd * cobra.Command , args []string ) {
299+ var (
300+ app = forceFlagGetStrValue (cmd , "application" , "Enter Application Name:" )
301+ dom = forceFlagGetStrValue (cmd , "domain" , "Enter Domain:" )
302+ path = forceFlagGetStrValue (cmd , "path" , "Enter Path:" )
303+ ep = forceFlagGetStrValue (cmd , "endpoint" , "Enter Endpoint [ format: 8080/http ]:" )
304+ )
305+
309306 req := new (ybApi.SrvDomainAttachReq )
310307 req .AttachIdentity = new (ybApi.AttachIdentity )
311- req .AttachIdentity .Name = cmd .Flag ("application" ).Value .String ()
312- req .AttachIdentity .Attachment = cmd .Flag ("domain" ).Value .String ()
313- req .Path = cmd .Flag ("path" ).Value .String ()
308+ req .AttachIdentity .Name = app
309+ req .AttachIdentity .Attachment = dom
310+ req .Path = path
311+ req .Endpoint = ep
314312
315313 client := grpcConnect ()
316314 defer client .Close ()
0 commit comments