Add basic resource trimming command (#41780)

* Add basic trim command

* Indent properly

* Actually apply defaults if the user asks for it
This commit is contained in:
sam boyer
2021-11-18 10:02:11 -05:00
committed by GitHub
parent c82a15eafb
commit fc3ed34b22
2 changed files with 75 additions and 0 deletions

View File

@ -214,6 +214,22 @@ so must be recompiled to validate newly-added CUE files.`,
},
},
},
{
Name: "trim-resource",
Usage: "trim schema-specified defaults from a resource",
Action: runCueCommand(cmd.trimResource),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "dashboard",
Usage: "path to file containing (valid) dashboard JSON",
},
&cli.BoolFlag{
Name: "apply",
Usage: "invert the operation: apply defaults instead of trimming them",
Value: false,
},
},
},
{
Name: "gen-ts",
Usage: "generate TypeScript from all known CUE file types",