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()
{
cmd=""
if [ $# -gt 0 ]; then
cmd="$1"
shift 1
fi
cmd="" && [ $# -gt 0 ] && cmd="$1" && shift 1
case "$cmd" in
version)
printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
release|inject)
$cmd "$@" ;;
-*)
return 1 ;;
*)
$err "bad command" ;;
version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
release|inject) $cmd "$@" ;;
-*) return 1 ;;
*) $err "bad command" ;;
esac
set -u -e # some commands disable them. turn them on!
}