pulumi/pkg/util/cmdutil
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
..
args.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
child.go Add (back) component outputs 2017-11-20 17:38:09 -08:00
child_windows.go Add (back) component outputs 2017-11-20 17:38:09 -08:00
diag.go Have engine emit "events" instead of writing to streams 2017-10-09 18:24:56 -07:00
exit.go Argument validation for CLI commands 2017-11-29 16:10:53 -08:00
log.go Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00
log_test.go Clarify aspects of using the DCO 2017-06-26 14:46:34 -07:00
trace.go Initial work on tracing support (#521) 2017-11-08 17:08:51 -08:00