We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1513428 commit b136f38Copy full SHA for b136f38
libexec/demo-core.d/prompt
@@ -23,10 +23,9 @@ _@go.prompt_demo() {
23
@go.printf 'Nice to meet you, %s!\n' "$name"
24
25
if @go.prompt_for_yes_or_no 'Do you have a quest?' 'yes'; then
26
- # Default value applies if input is empty.
27
- if ! @go.prompt_for_input 'quest' $'What is your quest?\n' "$quest"; then
28
- return 1
29
- fi
+ # Default value applies if input is empty. Since there is a default, this
+ # won't return an error on no input.
+ @go.prompt_for_input 'quest' $'What is your quest?\n' "$quest"
30
elif ! @go.prompt_for_yes_or_no "Might I suggest: $quest" 'yes'; then
31
@go.printf 'OK, no quest. Suit yourself!\n'
32
return 1
0 commit comments