From 3641645909b285546af528f9a58b0ab10cf3e9dc Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Wed, 23 Sep 2026 13:39:59 -0500 Subject: [PATCH] Added a check for unexpected arguments to dunedaq_integtest_bundle.sh so that users noticed when they mis-typed a command. --- scripts/dunedaq_integtest_bundle.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/dunedaq_integtest_bundle.sh b/scripts/dunedaq_integtest_bundle.sh index 19a65d2..e9dfd3d 100755 --- a/scripts/dunedaq_integtest_bundle.sh +++ b/scripts/dunedaq_integtest_bundle.sh @@ -69,6 +69,15 @@ invalid_numeric_option_value() { echo "" } +# function to report one or more unexpected command-line arguments +unexpected_command_arguments() { + declare -r script_name=$(basename "$0") + echo "" + echo -e "\U0001F534 ERROR: ${script_name} received unexpected command-line argument(s): $@" + echo ">>> Reminder: running '${script_name} --help' will list the supported options" + echo "" +} + # function to check for a specific string in a list string_in_list() { # get the search string from the first argument @@ -330,6 +339,13 @@ while true; do esac done +# if any command-line arguments remain after all of the 'getopt' processing, that is +# a problem (since we don't expect any), so we let the user know. +if [ $# -ne 0 ]; then + unexpected_command_arguments "$@" + exit 1 +fi + # assemble the basic elements for the pytest command that we will use if [[ "${#PYTEST_OPTIONS[@]}" -gt 0 ]]; then PYTEST_BASE_COMMAND+=("${PYTEST_OPTIONS[@]}" "--") # Add the requested options to the pytest command