feat: add cli first class validation (#8374)

* feat: add cli first class validation
* feat: add required flag to cli options
* Add unit test to catch invalid and missing flag
This commit is contained in:
Steven Masley
2023-07-11 09:59:55 -04:00
committed by GitHub
parent 3f6a158016
commit bc102d6bd7
10 changed files with 186 additions and 32 deletions

View File

@ -23,6 +23,10 @@ const (
type Option struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
// Required means this value must be set by some means. It requires
// `ValueSource != ValueSourceNone`
// If `Default` is set, then `Required` is ignored.
Required bool `json:"required,omitempty"`
// Flag is the long name of the flag used to configure this option. If unset,
// flag configuring is disabled.