pulumi/cmd
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
..
lumidl Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
api.go Canonicalize where we use the Pulumi API (#556) 2017-11-13 18:25:57 -08:00
backend.go Refactoring of OperationsProvider code 2017-11-19 22:28:49 -08:00
backend_cloud.go Merge branch 'master' of github.com:pulumi/pulumi into resource_parenting_lite 2017-11-29 12:14:39 -08:00
backend_local.go Merge branch 'master' of github.com:pulumi/pulumi into resource_parenting_lite 2017-11-29 08:16:38 -08:00
config.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
config_test.go Save config information in Pulumi.yaml 2017-10-20 13:30:07 -07:00
creds.go Add 'pulumi login' test 2017-11-02 11:19:00 -07:00
crypt.go Bring back component outputs 2017-11-29 07:42:14 -08:00
debug_cmds.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
destroy.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
init.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
login.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
logs.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
logs_test.go Address PR feedback on #600 (#611) 2017-11-28 12:54:36 -08:00
preview.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
provider_local.go Add (back) component outputs 2017-11-20 17:38:09 -08:00
pulumi.go Bring back component outputs 2017-11-29 07:42:14 -08:00
stack.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
stack_init.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
stack_ls.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
stack_rm.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
stack_select.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
update.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
util.go Change configuration verbs for getting and setting values 2017-11-16 11:39:28 -08:00
util_password.go Encrypt secrets in Pulumi.yaml 2017-10-24 16:48:12 -07:00
util_password_windows.go Encrypt secrets in Pulumi.yaml 2017-10-24 16:48:12 -07:00
version.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00