MCPcopy Index your code
hub / github.com/cortexlabs/cortex / IntFromPrompt

Function IntFromPrompt

pkg/lib/configreader/int.go:153–160  ·  view source on GitHub ↗
(promptOpts *prompt.Options, v *IntValidation)

Source from the content-addressed store, hash-verified

151}
152
153func IntFromPrompt(promptOpts *prompt.Options, v *IntValidation) (int, error) {
154 promptOpts.DefaultStr = s.Int(v.Default)
155 valStr := prompt.Prompt(promptOpts)
156 if valStr == "" {
157 return ValidateIntMissing(v)
158 }
159 return IntFromStr(valStr, v)
160}
161
162func ValidateIntMissing(v *IntValidation) (int, error) {
163 if v.Required {

Callers 1

ReadPromptFunction · 0.85

Calls 3

PromptFunction · 0.92
ValidateIntMissingFunction · 0.85
IntFromStrFunction · 0.85

Tested by

no test coverage detected