mirror of
https://github.com/coder/coder.git
synced 2025-07-23 21:32:07 +00:00
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:
@ -398,6 +398,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
|
||||
},
|
||||
"hidden": true,
|
||||
"name": "string",
|
||||
"required": true,
|
||||
"use_instead": [{}],
|
||||
"value": null,
|
||||
"value_source": "",
|
||||
|
@ -533,6 +533,7 @@
|
||||
},
|
||||
"hidden": true,
|
||||
"name": "string",
|
||||
"required": true,
|
||||
"use_instead": [
|
||||
{
|
||||
"annotations": {
|
||||
@ -557,6 +558,7 @@
|
||||
},
|
||||
"hidden": true,
|
||||
"name": "string",
|
||||
"required": true,
|
||||
"use_instead": [],
|
||||
"value": null,
|
||||
"value_source": "",
|
||||
@ -571,21 +573,22 @@
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ---------------- | ------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `annotations` | [clibase.Annotations](#clibaseannotations) | false | | Annotations enable extensions to clibase higher up in the stack. It's useful for help formatting and documentation generation. |
|
||||
| `default` | string | false | | Default is parsed into Value if set. |
|
||||
| `description` | string | false | | |
|
||||
| `env` | string | false | | Env is the environment variable used to configure this option. If unset, environment configuring is disabled. |
|
||||
| `flag` | string | false | | Flag is the long name of the flag used to configure this option. If unset, flag configuring is disabled. |
|
||||
| `flag_shorthand` | string | false | | Flag shorthand is the one-character shorthand for the flag. If unset, no shorthand is used. |
|
||||
| `group` | [clibase.Group](#clibasegroup) | false | | Group is a group hierarchy that helps organize this option in help, configs and other documentation. |
|
||||
| `hidden` | boolean | false | | |
|
||||
| `name` | string | false | | |
|
||||
| `use_instead` | array of [clibase.Option](#clibaseoption) | false | | Use instead is a list of options that should be used instead of this one. The field is used to generate a deprecation warning. |
|
||||
| `value` | any | false | | Value includes the types listed in values.go. |
|
||||
| `value_source` | [clibase.ValueSource](#clibasevaluesource) | false | | |
|
||||
| `yaml` | string | false | | Yaml is the YAML key used to configure this option. If unset, YAML configuring is disabled. |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ---------------- | ------------------------------------------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `annotations` | [clibase.Annotations](#clibaseannotations) | false | | Annotations enable extensions to clibase higher up in the stack. It's useful for help formatting and documentation generation. |
|
||||
| `default` | string | false | | Default is parsed into Value if set. |
|
||||
| `description` | string | false | | |
|
||||
| `env` | string | false | | Env is the environment variable used to configure this option. If unset, environment configuring is disabled. |
|
||||
| `flag` | string | false | | Flag is the long name of the flag used to configure this option. If unset, flag configuring is disabled. |
|
||||
| `flag_shorthand` | string | false | | Flag shorthand is the one-character shorthand for the flag. If unset, no shorthand is used. |
|
||||
| `group` | [clibase.Group](#clibasegroup) | false | | Group is a group hierarchy that helps organize this option in help, configs and other documentation. |
|
||||
| `hidden` | boolean | false | | |
|
||||
| `name` | string | false | | |
|
||||
| `required` | boolean | false | | Required means this value must be set by some means. It requires `ValueSource != ValueSourceNone` If `Default` is set, then `Required` is ignored. |
|
||||
| `use_instead` | array of [clibase.Option](#clibaseoption) | false | | Use instead is a list of options that should be used instead of this one. The field is used to generate a deprecation warning. |
|
||||
| `value` | any | false | | Value includes the types listed in values.go. |
|
||||
| `value_source` | [clibase.ValueSource](#clibasevaluesource) | false | | |
|
||||
| `yaml` | string | false | | Yaml is the YAML key used to configure this option. If unset, YAML configuring is disabled. |
|
||||
|
||||
## clibase.Struct-array_codersdk_GitAuthConfig
|
||||
|
||||
@ -2099,6 +2102,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
},
|
||||
"hidden": true,
|
||||
"name": "string",
|
||||
"required": true,
|
||||
"use_instead": [{}],
|
||||
"value": null,
|
||||
"value_source": "",
|
||||
|
Reference in New Issue
Block a user