mk: condense main() again

i prefer it this way. this reverses the change that
i made a few revisions ago

Signed-off-by: Leah Rowe <leah@libreboot.org>
25.04_branch
Leah Rowe 2025-04-26 23:07:25 +01:00
parent 4ff7cd3d77
commit d85ec327c3
1 changed files with 5 additions and 13 deletions

18
mk
View File

@ -20,21 +20,13 @@ eval "`setvars "" vdir src_dirname srcdir mode`"
main() main()
{ {
cmd="" cmd="" && [ $# -gt 0 ] && cmd="$1" && shift 1
if [ $# -gt 0 ]; then
cmd="$1"
shift 1
fi
case "$cmd" in case "$cmd" in
version) version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;; release|inject) $cmd "$@" ;;
release|inject) -*) return 1 ;;
$cmd "$@" ;; *) $err "bad command" ;;
-*)
return 1 ;;
*)
$err "bad command" ;;
esac esac
set -u -e # some commands disable them. turn them on! set -u -e # some commands disable them. turn them on!
} }