Commit 22514d52 authored by Matthieu Baerts's avatar Matthieu Baerts Committed by Jakub Kicinski

selftests: mptcp: join: exit after usage()

With an error if it is an unknown option.
Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent bccefb76
...@@ -2077,8 +2077,14 @@ all_tests() ...@@ -2077,8 +2077,14 @@ all_tests()
fullmesh_tests fullmesh_tests
} }
# [$1: error message]
usage() usage()
{ {
if [ -n "${1}" ]; then
echo "${1}"
ret=1
fi
echo "mptcp_join usage:" echo "mptcp_join usage:"
echo " -f subflows_tests" echo " -f subflows_tests"
echo " -e subflows_error_tests" echo " -e subflows_error_tests"
...@@ -2099,6 +2105,8 @@ usage() ...@@ -2099,6 +2105,8 @@ usage()
echo " -C enable data checksum" echo " -C enable data checksum"
echo " -i use ip mptcp" echo " -i use ip mptcp"
echo " -h help" echo " -h help"
exit ${ret}
} }
sin=$(mktemp) sin=$(mktemp)
...@@ -2187,9 +2195,12 @@ while getopts 'fesltra64bpkdmchCSi' opt; do ...@@ -2187,9 +2195,12 @@ while getopts 'fesltra64bpkdmchCSi' opt; do
;; ;;
i) i)
;; ;;
h | *) h)
usage usage
;; ;;
*)
usage "Unknown option: -${opt}"
;;
esac esac
done done
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment