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

Function promptForBoolVariable

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

Source from the content-addressed store, hash-verified

629}
630
631func promptForBoolVariable(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) (string, error) {
632 defaultValue := variable.DefaultValue
633 if defaultValue == "" {
634 defaultValue = "false"
635 }
636
637 return cliui.Select(inv, cliui.SelectOptions{
638 Options: []string{"true", "false"},
639 Default: defaultValue,
640 Message: "Select value:",
641 })
642}
643
644func promptForNumberVariable(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) (string, error) {
645 prompt := "Enter value:"

Callers 1

Calls 1

SelectFunction · 0.92

Tested by

no test coverage detected