summaryrefslogtreecommitdiff
path: root/bin/check-elf-dynamic-objects
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-02-20 12:43:02 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-06-01 10:06:22 +0200
commit564150f62d70466b50a887efb472562d169ee9d0 (patch)
treea648935f879a8078631e3f24e7898fb9ac9d89b4 /bin/check-elf-dynamic-objects
parent017071169f5c043447a863da093afd58e768fecc (diff)
Add missing die and help functions
Change-Id: Ic2e6138b1ba1a8031a80e4e58f468b6c0f7a4de3
Diffstat (limited to 'bin/check-elf-dynamic-objects')
-rwxr-xr-xbin/check-elf-dynamic-objects30
1 files changed, 27 insertions, 3 deletions
diff --git a/bin/check-elf-dynamic-objects b/bin/check-elf-dynamic-objects
index 1a11e6dca223..f5e4b0e0d4e1 100755
--- a/bin/check-elf-dynamic-objects
+++ b/bin/check-elf-dynamic-objects
@@ -15,6 +15,24 @@ set -euo pipefail
PARA=1
check_path="${INSTDIR:-.}"
+help()
+{
+ cat << "EOF"
+ -d <dir> directory to check
+ -p run unbound parallel checks
+ -h help
+EOF
+ [ -z "${1:-}" ] && exit 0
+}
+
+die()
+{
+ echo "$1"
+ echo
+ help 1
+ exit 1
+}
+
while [ "${1:-}" != "" ]; do
parm=${1%%=*}
arg=${1#*=}
@@ -28,12 +46,18 @@ while [ "${1:-}" != "" ]; do
case "${parm}" in
--dir|-d)
if [ "$has_arg" ] ; then
- check_path=$arg
+ check_path="$arg"
else
shift
- check_path=$1
+ check_path="$1"
fi
- ;;
+ if [ ! -d "$check_path" ]; then
+ die "Invalid directory '$check_path'"
+ fi
+ ;;
+ -h)
+ help
+ ;;
-p)
# this sound counter intuitive. but the idea
# is to possibly support -p <n>