Improved argument parsing

This commit is contained in:
root 2020-02-27 21:16:31 +01:00
parent 755c3519df
commit 83f1367297

View file

@ -18,8 +18,8 @@ INPUT="/proc/mdstat"
DEBUG=false DEBUG=false
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
-r|--raid) TARGET_RAID_NAME="$2";; -r|--raid) TARGET_RAID_NAME="$2"; shift;;
-i|--input) INPUT="$2";; -i|--input) INPUT="$2"; shift;;
-d|--debug) DEBUG=true;; -d|--debug) DEBUG=true;;
-?|--help) -?|--help)
echo "Check /proc/mdstat. Arguments:" echo "Check /proc/mdstat. Arguments:"