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