mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Show template description in coder template init (#2238)
This commit is contained in:
+7
-2
@@ -24,8 +24,13 @@ func templateInit() *cobra.Command {
|
||||
exampleNames := []string{}
|
||||
exampleByName := map[string]examples.Example{}
|
||||
for _, example := range exampleList {
|
||||
exampleNames = append(exampleNames, example.Name)
|
||||
exampleByName[example.Name] = example
|
||||
name := fmt.Sprintf(
|
||||
"%s\n%s\n",
|
||||
cliui.Styles.Bold.Render(example.Name),
|
||||
cliui.Styles.Wrap.Copy().PaddingLeft(6).Render(example.Description),
|
||||
)
|
||||
exampleNames = append(exampleNames, name)
|
||||
exampleByName[name] = example
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintln(cmd.OutOrStdout(), cliui.Styles.Wrap.Render(
|
||||
|
||||
Reference in New Issue
Block a user