Implement promptCustom in cli and use it for init command.
This commit is contained in:
parent
9b67f424e6
commit
a111d5f3b9
2 changed files with 25 additions and 25 deletions
|
|
@ -128,6 +128,20 @@ proc prompt*(forcePrompts: ForcePrompt, question: string): bool =
|
|||
else:
|
||||
return false
|
||||
|
||||
proc promptCustom*(question, default: string): string =
|
||||
if default == "":
|
||||
display("Prompt:", question, Warning, HighPriority)
|
||||
displayCategory("Answer:", Warning, HighPriority)
|
||||
let user = stdin.readLine()
|
||||
if user.len == 0: return promptCustom(question, default)
|
||||
else: return user
|
||||
else:
|
||||
display("Prompt:", question & " [" & default & "]", Warning, HighPriority)
|
||||
displayCategory("Answer:", Warning, HighPriority)
|
||||
let user = stdin.readLine()
|
||||
if user == "": return default
|
||||
else: return user
|
||||
|
||||
proc setVerbosity*(level: Priority) =
|
||||
globalCLI.level = level
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue