fix: add mutual exclusion for OrgId and OrgName params (#377)
Display an error when the OrgName and OrgId flags are both passed in. Only one or the other is allowed. closes https://github.com/influxdata/influx-cli/issues/371
This commit is contained in:
@ -108,6 +108,9 @@ func newTemplateCmd() cli.Command {
|
||||
),
|
||||
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
|
||||
Action: func(ctx *cli.Context) error {
|
||||
if err := checkOrgFlags(¶ms.orgParams); err != nil {
|
||||
return err
|
||||
}
|
||||
parsedParams := template.SummarizeParams{
|
||||
OrgParams: params.orgParams,
|
||||
RenderTableColors: !params.noColor,
|
||||
@ -138,6 +141,9 @@ func newTemplateValidateCmd() cli.Command {
|
||||
Flags: append(commonFlagsNoPrint(), templateFlags(¶ms)...),
|
||||
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
|
||||
Action: func(ctx *cli.Context) error {
|
||||
if err := checkOrgFlags(¶ms.orgParams); err != nil {
|
||||
return err
|
||||
}
|
||||
parsedParams := template.ValidateParams{
|
||||
OrgParams: params.orgParams,
|
||||
}
|
||||
|
Reference in New Issue
Block a user