#Parase parameters and configuration to reset variables accordingly for param in $@; do if [ "${param:0:2}" = "--" ]; then case "${param:2}" in file) FILE=1 ;; url) URL=1 ;; color) COLOR=1 ;; install) INSTALL=1 ;; help) usage ;; *) err_msg "Option \`$param' not recognized, see depcheck --help." ;; esac elif [ "${param:0:1}" = "-" ]; then shortparam="$(sed 's/[a-zA-Z0-9]/& /g' <<<${param:1})" for character in ${shortparam}; do case $character in f) FILE=1 ;; u) URL=1 ;; c) COLOR=1 ;; i) INSTALL=1 ;; h) usage ;; *) err_msg "Option \`$character' not recognized, see depcheck --help." ;; esac done elif [ "${param##*.}" = "dep" ]; then DEPFILE="$param" else err_msg "Incorrect usage, see depcheck --help." fi done