[coreboot-gerrit] New patch to review for coreboot: util/abuild: Add more error handling for command line options

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Tue Dec 6 23:26:06 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17741

-gerrit

commit eb94d3c811a6dc5b7cbccbec81f796016fa81050
Author: Martin Roth <martinroth at google.com>
Date:   Tue Dec 6 09:51:54 2016 -0700

    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 <martinroth at google.com>
---
 util/abuild/abuild | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/util/abuild/abuild b/util/abuild/abuild
index 65f55a0..88787e8 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -679,10 +679,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."



More information about the coreboot-gerrit mailing list