From 4b25263cd407e3f0bc6fc582edd3bad5fb78872f Mon Sep 17 00:00:00 2001 From: jash Date: Sat, 13 Oct 2018 13:12:54 +0200 Subject: [PATCH] default mode is -ci now --- dist/setup.sh | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/dist/setup.sh b/dist/setup.sh index 3278c78..cd30f76 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -127,7 +127,7 @@ INSTALL=0 RECREATE=0 TRACING=1 -while getopts ":cir" opt; do +while getopts ":cirh" opt; do case $opt in r) RECREATE=1 @@ -138,23 +138,28 @@ while getopts ":cir" opt; do i) INSTALL=1 ;; + h) + echo "Use -c to configure and -i to install or -r to recreate from config.json." >&2 + exit + ;; \?) - echo "Invalid option: -$OPTARG. Use -c to configure and -i to install" >&2 + echo "Invalid option: -$OPTARG. Use -c to configure and -i to install or -r to recreate from config.json." >&2 ;; esac done -if [[ $CONFIGURE == 0 && $INSTALL == 0 && RECREATE == 0 ]]; then - echo "Please use -c to configure, -i to install and -ci to do both. Use -r to recreate config files." -else - if [[ $CONFIGURE == 1 ]]; then - trace "Starting configuration phase" - configure $RECREATE - fi - - if [[ $INSTALL == 1 ]]; then - trace "Starting installation phase" - install - fi +if [[ $CONFIGURE == 0 && $INSTALL == 0 && $RECREATE == 0 ]]; then + CONFIGURE=1 + INSTALL=1 +fi + +if [[ $CONFIGURE == 1 ]]; then + trace "Starting configuration phase" + configure $RECREATE +fi + +if [[ $INSTALL == 1 ]]; then + trace "Starting installation phase" + install fi