From 9fdb41ab9a60c59d1c3ae727da7247f1de46c9d3 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Tue, 6 Dec 2016 09:51:54 -0700 Subject: util/abuild: Add more error handling for command line options - Show an error if a directory is added after the command line options to catch scripts using the old parameters. - If an invalid parameter is specified, show the parameter. Change-Id: Ie8948361f1c51e89a99bdb13df8c554747cd521d Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/17741 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- util/abuild/abuild | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/abuild/abuild b/util/abuild/abuild index 5509822e7d..c85db2c58d 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -676,10 +676,13 @@ while true ; do configoptions="$(cat "$1")${configoptions}\n" shift;; --) shift; break;; - -*) printf "Invalid option\n\n"; myhelp; exit 1;; + -*) printf "Invalid option '%s'\n\n" "$1"; myhelp; exit 1;; *) break;; esac done +if [ -n "$1" ]; then + printf "Invalid option '%s'\n\n" "$1"; myhelp; exit 1; +fi if [ -z "$TARGET" ] || [ "$TARGET" = "/" ]; then echo "Please specify a valid, non-root build directory." -- cgit v1.2.3