Change arg handling a bit

This commit is contained in:
flyingscorpio@pinebook-pro 2020-04-11 09:46:17 +02:00
parent 17a891cd5f
commit d6a125a1d9

View file

@ -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