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

@ -27,7 +27,7 @@ func newOrgCreateCmd() cli.Command {
return cli.Command{
Name: "create",
Usage: "Create organization",
Before: middleware.WithBeforeFns(withCli(), withApi(true)),
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: append(
commonFlags(),
&cli.StringFlag{
@ -57,7 +57,7 @@ func newOrgDeleteCmd() cli.Command {
return cli.Command{
Name: "delete",
Usage: "Delete organization",
Before: middleware.WithBeforeFns(withCli(), withApi(true)),
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: append(
commonFlags(),
&cli.GenericFlag{
@ -83,7 +83,7 @@ func newOrgListCmd() cli.Command {
Name: "list",
Aliases: []string{"find", "ls"},
Usage: "List organizations",
Before: middleware.WithBeforeFns(withCli(), withApi(true)),
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: append(
commonFlags(),
&cli.StringFlag{
@ -114,7 +114,7 @@ func newOrgUpdateCmd() cli.Command {
return cli.Command{
Name: "update",
Usage: "Update organization",
Before: middleware.WithBeforeFns(withCli(), withApi(true)),
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: append(
commonFlags(),
&cli.GenericFlag{