Skip to content

Commit

Permalink
docs: add modes to validate command
Browse files Browse the repository at this point in the history
Adds valid modes in the help menu for `validate`.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
  • Loading branch information
andrewrynhard committed Jan 5, 2021
1 parent d455f91 commit 529c035
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cmd/talosctl/cmd/mgmt/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ var validateCmd = &cobra.Command{

func init() {
validateCmd.Flags().StringVarP(&validateConfigArg, "config", "c", "", "the path of the config file")
validateCmd.Flags().StringVarP(&validateModeArg, "mode", "m", "", "the mode to validate the config for")
validateCmd.Flags().StringVarP(
&validateModeArg,
"mode",
"m",
"",
fmt.Sprintf("the mode to validate the config for (valid values are %s, %s, and %s)", runtime.ModeMetal.String(), runtime.ModeCloud.String(), runtime.ModeContainer.String()),
)
cli.Should(validateCmd.MarkFlagRequired("mode"))
addCommand(validateCmd)
}
2 changes: 1 addition & 1 deletion website/content/docs/v0.8/Reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ talosctl validate [flags]
```
-c, --config string the path of the config file
-h, --help help for validate
-m, --mode string the mode to validate the config for
-m, --mode string the mode to validate the config for (valid values are metal, cloud, and container)
```

### Options inherited from parent commands
Expand Down

0 comments on commit 529c035

Please sign in to comment.