(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable)
| 642 | } |
| 643 | |
| 644 | func promptForNumberVariable(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) (string, error) { |
| 645 | prompt := "Enter value:" |
| 646 | if !variable.Required && variable.DefaultValue != "" { |
| 647 | prompt = fmt.Sprintf("Enter value (default: %q):", variable.DefaultValue) |
| 648 | } |
| 649 | |
| 650 | return cliui.Prompt(inv, cliui.PromptOptions{ |
| 651 | Text: prompt, |
| 652 | Default: variable.DefaultValue, |
| 653 | Validate: createVariableValidator(variable), |
| 654 | }) |
| 655 | } |
| 656 | |
| 657 | func promptForStringVariable(inv *serpent.Invocation, variable codersdk.TemplateVersionVariable) (string, error) { |
| 658 | prompt := "Enter value:" |
no test coverage detected