parameter system: fix handling of --help/-h flag

This commit is contained in:
Andreas Lauser 2013-09-24 18:58:47 +02:00
parent 8276063c68
commit 537bf6a1bd

View File

@ -194,20 +194,20 @@ EndTime=100
InitialTimeStepSize=100 InitialTimeStepSize=100
UndefinedParam="blubb" UndefinedParam="blubb"
EOF EOF
if ! $TEST_BINARY --parameter-file="paramfile-$RND.ini" > /dev/null; then if ! $TEST_BINARY --parameter-file="paramfile-$RND.ini" 2>&1 > /dev/null; then
echo "$TEST_BINARY does not correctly read a parameter file" echo "$TEST_BINARY does not correctly read a parameter file"
exit 1 exit 1
elif $TEST_BINARY --parameter-file="foobar.ini" > /dev/null; then elif $TEST_BINARY --parameter-file="foobar.ini" 2>&1 > /dev/null; then
echo "$TEST_BINARY does not abort even though the specified parameter file does not exist" echo "$TEST_BINARY does not abort even though the specified parameter file does not exist"
exit 1 exit 1
elif ! $TEST_BINARY --foo --end-time=1 > /dev/null; then elif ! $TEST_BINARY --foo --end-time=1 2>&1 > /dev/null; then
echo "$TEST_BINARY des not accept a flag parameters" echo "$TEST_BINARY does not accept a flag parameters"
exit 1 exit 1
fi fi
# test some invalid parameter names # test some invalid parameter names
for PARAM in foo -- -0foo --0foo --foo--bar --foo- -foo --foo-bar§=abc ; do for PARAM in foo -- -0foo --0foo --foo--bar --foo- -foo --foo-bar§=abc ; do
if $TEST_BINARY "$PARAM" --end-time=100 > /dev/null; then if $TEST_BINARY "$PARAM" --end-time=100 2>&1 > /dev/null; then
echo "$TEST_BINARY accepted invalid command line option '$PARAM'" echo "$TEST_BINARY accepted invalid command line option '$PARAM'"
exit 1 exit 1
fi fi