From: Stefano Stabellini Date: Tue, 14 Apr 2015 11:13:47 +0000 (+0000) Subject: Introduce --no option to reply no to all questions X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9664a068320a1d1e4f5e66137b88795664f96c4b;p=raisin.git Introduce --no option to reply no to all questions Signed-off-by: Stefano Stabellini --- diff --git a/lib/commands.sh b/lib/commands.sh index bf5493b..b330209 100755 --- a/lib/commands.sh +++ b/lib/commands.sh @@ -15,7 +15,10 @@ function check-builddep() { if [[ -n "${missing[@]}" ]] then echo "Missing packages: ${missing[@]}" - if [[ $YES != "y" ]] + if [[ "$YES" = "n" ]] + then + return + elif [[ "$YES" != "y" ]] then echo "Do you want Raisin to automatically install them for you? (y/n)" while read answer @@ -74,7 +77,10 @@ function install() { } function configure() { - if [[ $YES != "y" ]] + if [[ "$YES" = "n" ]] + then + return + elif [[ "$YES" != "y" ]] then echo "Proceeding we'll make changes to the running system," echo "are you sure that you want to continue? (y/n)" diff --git a/raise b/raise index b254904..94507d2 100755 --- a/raise +++ b/raise @@ -7,6 +7,7 @@ _help() { echo "where options are:" echo " -v | --verbose Verbose" echo " -y | --yes Do not ask questions and continue" + echo " -n | --no No to all questions" echo "where commands are:" echo " install-builddep Install build time dependencies (requires sudo)" echo " build Build the components enabled in config" @@ -41,7 +42,7 @@ common_init # parameters check export VERBOSE=0 -export YES="n" +export YES="" while [[ $# -gt 1 ]] do if [[ "$1" = "-v" || "$1" = "--verbose" ]] @@ -52,6 +53,10 @@ do then YES="y" shift 1 + elif [[ "$1" = "-n" || "$1" = "--no" ]] + then + YES="n" + shift 1 else _help exit 1