MCPcopy Index your code
hub / github.com/coder/coder / displayVariableInfo

Function displayVariableInfo

cli/templatepush.go:614–629  ·  view source on GitHub ↗
(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable)

Source from the content-addressed store, hash-verified

612}
613
614func displayVariableInfo(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) {
615 _, _ = fmt.Fprintf(inv.Stderr, "var.%s", cliui.Bold(variable.Name))
616 if variable.Required {
617 _, _ = fmt.Fprint(inv.Stderr, pretty.Sprint(cliui.DefaultStyles.Error, " (required)"))
618 }
619 if variable.Sensitive {
620 _, _ = fmt.Fprint(inv.Stderr, pretty.Sprint(cliui.DefaultStyles.Warn, ", sensitive"))
621 }
622 _, _ = fmt.Fprintln(inv.Stderr, "")
623
624 if variable.Description != "" {
625 _, _ = fmt.Fprintf(inv.Stderr, " Description: %s\n", variable.Description)
626 }
627 _, _ = fmt.Fprintf(inv.Stderr, " Type: %s\n", variable.Type)
628 _, _ = fmt.Fprintf(inv.Stderr, " Current value: %s\n", pretty.Sprint(cliui.DefaultStyles.Placeholder, "<empty>"))
629}
630
631func promptForBoolVariable(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) (string, error) {
632 defaultValue := variable.DefaultValue

Callers 1

Calls 1

BoldFunction · 0.92

Tested by

no test coverage detected