From d6a125a1d98b287cf5b26a3678f310143b10efbc Mon Sep 17 00:00:00 2001 From: "flyingscorpio@pinebook-pro" Date: Sat, 11 Apr 2020 09:46:17 +0200 Subject: [PATCH] Change arg handling a bit --- main_install.sh | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/main_install.sh b/main_install.sh index b2c88e5..e039957 100755 --- a/main_install.sh +++ b/main_install.sh @@ -79,24 +79,26 @@ export OS OVERWRITE='false' UPDATE='false' -case "$1" in - -o | --overwrite ) - echo "${ORANGE}You agree to overwrite preexisting files!${NC}" - OVERWRITE='true' - ;; - -u | --update ) - echo "${ORANGE}Set to update plugins!${NC}" - UPDATE='true' - ;; - -ou | -uo ) - echo "${ORANGE}Both options were set.${NC}" - OVERWRITE='true' - UPDATE='true' - ;; - * ) - echo "Din't understand arguments" - exit 1 -esac +if [ "$#" -ge 1 ]; then + case "$1" in + -o | --overwrite ) + echo "${ORANGE}You agree to overwrite preexisting files!${NC}" + OVERWRITE='true' + ;; + -u | --update ) + echo "${ORANGE}Set to update plugins!${NC}" + UPDATE='true' + ;; + -ou | -uo ) + echo "${ORANGE}Both options were set.${NC}" + OVERWRITE='true' + UPDATE='true' + ;; + * ) + echo "Din't understand arguments" + exit 1 + esac +fi if [ "$#" -eq 2 ]; then case "$2" in -o | --overwrite ) @@ -154,7 +156,7 @@ setup_sddm() { # {{{ separator } # }}} -setup_sddm +# setup_sddm update_i3() { # {{{ # Update i3 configuration @@ -164,7 +166,7 @@ update_i3() { # {{{ separator } # }}} -update_i3 +# update_i3 configure_protonvpn() { # {{{ # Configure ProtonVPN @@ -209,7 +211,7 @@ configure_git() { # {{{ separator } # }}} -configure_git +# configure_git install_rust() { # {{{ # Install Rust @@ -279,4 +281,4 @@ clone_projects() { # {{{ separator } # }}} -# clone_projects +clone_projects