simplify getopts loops in shell scripts

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-09-26 01:34:10 +01:00
parent 36b7f01a8a
commit 67f4919ffe
3 changed files with 15 additions and 35 deletions
+4 -9
View File
@@ -15,16 +15,11 @@ main()
while getopts b:c: option
do
case "${1}" in
-b)
shift ;;
-c)
mode="distclean"
shift ;;
*)
err "Invalid option" ;;
-b) : ;;
-c) mode="distclean" ;;
*) err "Invalid option" ;;
esac
project="${OPTARG}"
shift
shift; project="${OPTARG}"; shift
done
[ -z "${project}" ] && err "project name not specified"