File tree 2 files changed +12
-18
lines changed
2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,13 @@ var Commands = []cli.Command{
51
51
ArgsUsage : "[network] [group]" ,
52
52
Flags : []cli.Flag {
53
53
tenantFlag ,
54
- cli.StringFlag {
54
+ cli.StringSliceFlag {
55
55
Name : "policy, p" ,
56
- Usage : "Policy List (separated by commas) " ,
56
+ Usage : "Policy" ,
57
57
},
58
- cli.StringFlag {
59
- Name : "external-contracts , e" ,
60
- Usage : "External contracts(separated by commas) " ,
58
+ cli.StringSliceFlag {
59
+ Name : "external-contract , e" ,
60
+ Usage : "External contract " ,
61
61
},
62
62
},
63
63
Action : createEndpointGroup ,
@@ -291,9 +291,9 @@ var Commands = []cli.Command{
291
291
Name : "provided, p" ,
292
292
Usage : "External contracts type - provided" ,
293
293
},
294
- cli.StringFlag {
295
- Name : "contracts , a" ,
296
- Usage : "Contracts (separated by commas) " ,
294
+ cli.StringSliceFlag {
295
+ Name : "contract , a" ,
296
+ Usage : "Contract " ,
297
297
},
298
298
},
299
299
Action : createExternalContracts ,
Original file line number Diff line number Diff line change @@ -396,15 +396,9 @@ func createEndpointGroup(ctx *cli.Context) {
396
396
network := ctx .Args ()[0 ]
397
397
group := ctx .Args ()[1 ]
398
398
399
- policies := strings .Split (ctx .String ("policy" ), "," )
400
- if ctx .String ("policy" ) == "" {
401
- policies = []string {}
402
- }
399
+ policies := ctx .StringSlice ("policy" )
403
400
404
- extContractsGrps := strings .Split (ctx .String ("external-contracts" ), "," )
405
- if ctx .String ("external-contracts" ) == "" {
406
- extContractsGrps = []string {}
407
- }
401
+ extContractsGrps := ctx .StringSlice ("external-contract" )
408
402
409
403
errCheck (ctx , getClient (ctx ).EndpointGroupPost (& contivClient.EndpointGroup {
410
404
TenantName : tenant ,
@@ -865,8 +859,8 @@ func createExternalContracts(ctx *cli.Context) {
865
859
866
860
tenant := ctx .String ("tenant" )
867
861
868
- contracts := strings . Split ( ctx .String ("contracts" ), ", " )
869
- if ctx . String ( " contracts" ) == "" {
862
+ contracts := ctx .StringSlice ("contracts" )
863
+ if len ( contracts ) == 0 {
870
864
errExit (ctx , exitHelp , "Contracts not provided" , false )
871
865
}
872
866
You can’t perform that action at this time.
0 commit comments