minor update

This commit is contained in:
Nathaniel Landau
2015-01-03 10:52:37 -05:00
parent 4a7067bfc3
commit 5057a9975b

View File

@@ -200,14 +200,14 @@ function is_not_empty() {
# ------------------------------------------------------ # ------------------------------------------------------
function type_exists() { function type_exists() {
if [ $(type -P $1) ]; then if [ $(type -P "$1") ]; then
return 0 return 0
fi fi
return 1 return 1
} }
function type_not_exists() { function type_not_exists() {
if [ ! $(type -P $1) ]; then if [ ! $(type -P "$1") ]; then
return 0 return 0
fi fi
return 1 return 1
@@ -243,16 +243,18 @@ function is_os() {
# Ask the question # Ask the question
function seek_confirmation() { function seek_confirmation() {
printf "\n${bold}$@${reset}" echo ""
e_bold "$@"
read -p " (y/n) " -n 1 read -p " (y/n) " -n 1
printf "\n" echo ""
} }
# same as above but underlined # same as above but underlined
function seek_confirmation_head() { function seek_confirmation_head() {
printf "\n${underline}${bold}$@${reset}" echo ""
read -p "${underline}${bold} (y/n)${reset} " -n 1 e_underline "$@"
printf "\n" read -p " (y/n) " -n 1
echo ""
} }
# Test whether the result of an 'ask' is a confirmation # Test whether the result of an 'ask' is a confirmation