MCPcopy Create free account
hub / github.com/SamNet-dev/snix / promptLine

Function promptLine

cmd/snix/wizard.go:262–273  ·  view source on GitHub ↗

Helpers ----------------------------------------------------------------

(out io.Writer, in *bufio.Reader, prompt, def string)

Source from the content-addressed store, hash-verified

260// Helpers ----------------------------------------------------------------
261
262func promptLine(out io.Writer, in *bufio.Reader, prompt, def string) string {
263 fmt.Fprint(out, prompt)
264 line, err := in.ReadString('\n')
265 if err != nil {
266 return def
267 }
268 line = strings.TrimSpace(line)
269 if line == "" {
270 return def
271 }
272 return line
273}
274
275func promptYesNo(out io.Writer, in *bufio.Reader, prompt string, def bool) bool {
276 suffix := " (Y/n) "

Callers 1

runWizardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected