From 1a062bb62810ba555351a01bb17f74e3beb992a8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 18 May 2023 10:21:54 +0100 Subject: build: reduce code to less than 80 chars per line Signed-off-by: Leah Rowe --- build | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'build') diff --git a/build b/build index d050a48c..1eb39216 100755 --- a/build +++ b/build @@ -2,7 +2,7 @@ # generic build script, for building components (all of them) # -# Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe +# Copyright (C) 2014,2015,2020,2021,2023 Leah Rowe # Copyright (C) 2015 Patrick "P. J." McDermott # Copyright (C) 2015, 2016 Klemens Nanni # Copyright (C) 2022, Caleb La Grange @@ -54,7 +54,7 @@ help() { Example: ./build roms withgrub Example: ./build clean all - Refer to the ${projectname} documentation for more information. + Refer to ${projectname} documentation for more info. EOF } @@ -64,7 +64,7 @@ die() { } if [ $# -lt 1 ]; then - die "Wrong number of arguments specified. See './build help'." + die "Wrong argument count. Run: ./build help" fi mode="${1}" @@ -81,27 +81,27 @@ if [ $# -gt 1 ]; then shift 2 case "${option}" in - list) - printf "Available options for mode '%s':\n\n" "${mode}" - listoptions "${mode}" - ;; - all) - for option in $(listoptions "${mode}"); do - "${build}"/"${mode}"/"${option}" $@ - done - ;; - *) - if [ -d "${build}"/"${mode}"/ ]; then - if [ -f "${build}"/"${mode}"/"${option}" ]; then - "${build}"/"${mode}"/"${option}" $@ - else - help - die "Invalid option for '${mode}'. See './build ${mode} list'." - fi - else - help - die "Invalid mode '${mode}'. See './build help'." - fi + list) + printf "Options for mode '%s':\n\n" ${mode} + listoptions "${mode}" + ;; + all) + for option in $(listoptions "${mode}"); do + "${build}"/"${mode}"/"${option}" $@ + done + ;; + *) + if [ ! -d "${build}"/"${mode}"/ ]; then + help + die "Invalid mode '${mode}'. Run: ./build help" + fi + if [ -f "${build}"/"${mode}"/"${option}" ]; then + "${build}"/"${mode}"/"${option}" $@ + else + help + printf "Invalid option for '%s'." ${mode} + die "Run: ./build ${mode} list'." + fi esac else help -- cgit v1.2.1