MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / interactiveReadLineDefault

Function interactiveReadLineDefault

cmd/inject-cli/main.go:332–343  ·  view source on GitHub ↗
(prompt, defaultVal string)

Source from the content-addressed store, hash-verified

330}
331
332func interactiveReadLineDefault(prompt, defaultVal string) string {
333 if defaultVal != "" {
334 prompt = fmt.Sprintf("%s [%s]: ", prompt, defaultVal)
335 } else {
336 prompt += ": "
337 }
338 val := interactiveReadLine(prompt)
339 if val == "" {
340 return defaultVal
341 }
342 return val
343}
344
345// ----- completer -----
346

Callers 2

cmdRulesAddFunction · 0.85
buildArgumentsFunction · 0.85

Calls 1

interactiveReadLineFunction · 0.85

Tested by

no test coverage detected