pulumi/pkg
Matt Ellis 8f076b7cb3 Argument validation for CLI commands
Previously, we were inconsistent on how we handled argument validation
in the CLI. Many commands used cobra.Command's Args property to
provide a validator if they took arguments, but commands which did not
rarely used cobra.NoArgs to indicate this.

This change does two things:

1. Introduce `cmdutil.ArgsFunc` which works like `cmdutil.RunFunc`, it
wraps an existing cobra type and lets us control the behavior when an
arguments validator fails.

2. Ensure every command sets the Args property with an instance of
cmdutil.ArgsFunc. The cmdutil package defines wrapers for all the
cobra validators we are using, to prevent us from having to spell out
`cmduitl.ArgsFunc(...)` everywhere.

Fixes #588
2017-11-29 16:10:53 -08:00
..
apitype Move program uploads to the CLI (#571) 2017-11-15 13:27:28 -08:00
compiler/errors Use Stack over Environment to describe a deployment target 2017-10-16 13:04:20 -07:00
diag Add (back) component outputs 2017-11-20 17:38:09 -08:00
encoding Use go-yaml directly 2017-10-20 14:01:37 -07:00
engine Fix replacement ops regression (#620) 2017-11-29 15:05:58 -08:00
graph Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00
operations Merge branch 'master' of github.com:pulumi/pulumi into resource_parenting_lite 2017-11-29 08:16:38 -08:00
pack Provide a way to opt out of default ignores 2017-11-22 12:13:44 -08:00
resource Fix replacement ops regression (#620) 2017-11-29 15:05:58 -08:00
testing Merge remote-tracking branch 'origin/resource_parenting' into resource_parenting_lite 2017-11-28 11:03:34 -08:00
tokens Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00
tools Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00
util Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
workspace Merge remote-tracking branch 'origin/resource_parenting' into resource_parenting_lite 2017-11-28 11:03:34 -08:00