layerscape: mkits-multiple-config: fail on invalid arguments
Fail if arguments couldn't be parsed and print unrecognized part. It's important when running it from script with dynamic values. Missing value could result in skipping argument and silent failures (unexpected its). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
@@ -198,6 +198,11 @@ parse_args() {
|
|||||||
usage;;
|
usage;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
shift $(($OPTIND - 1))
|
||||||
|
[ $# -gt 0 ] && {
|
||||||
|
echo "Failed to parse all passed arguments (unrecognized: \"$@\")"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
[ -n "${OUTPUT}" ] || OUTPUT=fitimage.its
|
[ -n "${OUTPUT}" ] || OUTPUT=fitimage.its
|
||||||
[ -n "${VERSION}" ] || VERSION="Unknown"
|
[ -n "${VERSION}" ] || VERSION="Unknown"
|
||||||
[ -n "${ARCH}" ] || ARCH=arm
|
[ -n "${ARCH}" ] || ARCH=arm
|
||||||
|
|||||||
Reference in New Issue
Block a user