@@ -23,9 +23,16 @@ type infoCmd struct {
2323 info * draftInfo
2424}
2525
26+ // draftConfigInfo is a struct that contains information about the example usage of variables for a single draft.yaml
27+ type draftConfigInfo struct {
28+ Name string `json:"name"`
29+ DisplayName string `json:"displayName,omitempty"`
30+ VariableExampleValues map [string ][]string `json:"variableExampleValues,omitempty"`
31+ }
32+
2633type draftInfo struct {
27- SupportedLanguages []string `json:"supported_languages "`
28- SupportedDeploymentTypes []string `json:"supported_deployment_types "`
34+ SupportedLanguages []draftConfigInfo `json:"supportedLanguages "`
35+ SupportedDeploymentTypes []string `json:"supportedDeploymentTypes "`
2936}
3037
3138func newInfoCmd () * cobra.Command {
@@ -52,8 +59,19 @@ func (ic *infoCmd) run() error {
5259 l := languages .CreateLanguagesFromEmbedFS (template .Dockerfiles , "" )
5360 d := deployments .CreateDeploymentsFromEmbedFS (template .Deployments , "" )
5461
62+ languagesInfo := make ([]draftConfigInfo , 0 )
63+ for _ , lang := range l .Names () {
64+ langConfig := l .GetConfig (lang )
65+ newConfig := draftConfigInfo {
66+ Name : lang ,
67+ DisplayName : langConfig .DisplayName ,
68+ VariableExampleValues : langConfig .GetVariableExampleValues (),
69+ }
70+ languagesInfo = append (languagesInfo , newConfig )
71+ }
72+
5573 ic .info = & draftInfo {
56- SupportedLanguages : l . Names () ,
74+ SupportedLanguages : languagesInfo ,
5775 SupportedDeploymentTypes : d .DeployTypes (),
5876 }
5977
0 commit comments