Skip to content

Commit

Permalink
Add examples for question function
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-parlette committed Jul 14, 2016
1 parent e538a79 commit 3bfad8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bootstrap/bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ function show_help {
}

# Ask a question, defaults to yes
# Example:
# if yes_no_question "Question"
# then
# echo "User selected yes"
# else
# echo "User selected no"
# fi
function yes_no_question () {
read -r -p "$1 [Y/n] " response
response=${response,,}
Expand All @@ -25,6 +32,13 @@ function yes_no_question () {
}

# Ask a question, defaults to no
# Example:
# if no_yes_question "Question"
# then
# echo "User selected no"
# else
# echo "User selected yes"
# fi
function no_yes_question () {
read -r -p "$1 [Y/n] " response
response=${response,,}
Expand Down

0 comments on commit 3bfad8e

Please sign in to comment.