fix: detect and error out on incorrect positional args (#236)

This commit is contained in:
Daniel Moran
2021-08-20 17:30:30 -04:00
committed by GitHub
parent c0103e7b1b
commit fa12328714
24 changed files with 204 additions and 64 deletions

View File

@ -118,7 +118,7 @@ func newTemplateCmd() cli.Command {
Destination: &params.noTableBorders,
},
),
Before: middleware.WithBeforeFns(withCli(), withApi(true)),
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Action: func(ctx *cli.Context) error {
parsedParams := template.SummarizeParams{
OrgId: params.orgId,
@ -149,7 +149,7 @@ func newTemplateValidateCmd() cli.Command {
Name: "validate",
Usage: "Validate the provided template",
Flags: append(commonFlagsNoPrint(), templateFlags(&params)...),
Before: middleware.WithBeforeFns(withCli(), withApi(true)),
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Action: func(ctx *cli.Context) error {
parsedParams := template.ValidateParams{
OrgId: params.orgId,