Skip to content

Commit

Permalink
Fix parsing option values in run-examples script
Browse files Browse the repository at this point in the history
Fix parameter expansion so option values are kept correctly.
This fixes issues handling multi-value option arguments, e.g., allowing now
> ./run-examples.sh --mpi_args "-n 2 --oversubscribe 2 ..."

Signed-off-by: Christoph Niethammer <[email protected]>
  • Loading branch information
cniethammer committed Jan 16, 2025
1 parent 057f8e5 commit 276a07a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/run-examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Testscript running all examples from example-list.txt
#
# Copyright (c) 2017-2024 Christoph Niethammer <[email protected]>
# Copyright (c) 2017-2025 Christoph Niethammer <[email protected]>
#

# Some default values
Expand All @@ -13,7 +13,7 @@ MPIRUN_ARGS="-n 4 --oversubscribe"
EXAMPLE_LIST_FILE=${EXAMPLE_LIST_FILE:=example-list.txt}
LOGFILE=${LOGFILE:=$PWD/run-examples.log}

TEMP=$(getopt -o vh --long "help,inputlist:,logfile:,mardyn_args:,mardyn_exe:,mpirun_args:,mpirun_exe:,verbose" -- $@)
TEMP=$(getopt -o vh --long "help,inputlist:,logfile:,mardyn_args:,mardyn_exe:,mpirun_args:,mpirun_exe:,verbose" -- "$@")

if [ $? -ne 0 ]; then
echo "Error parsing commandline"
Expand Down

0 comments on commit 276a07a

Please sign in to comment.