Skip to content

Commit 4ad434c

Browse files
authored
Some fixes for tquic_tools_test.sh (#407)
- Fix handling of options 'l' and 's' - Return error code if argument is missing or invalid option was passed
1 parent 0582800 commit 4ad434c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/tests/tquic_tools_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ cleanup() {
3838
exit $EXIT_CODE
3939
}
4040

41-
# Ensure that all child processes have exited.
42-
trap 'cleanup' EXIT
43-
4441
show_help() {
4542
echo "Usage: $0 [options]"
4643
echo " -b, Set the directory of tquic_client/tquic_server."
@@ -55,7 +52,7 @@ show_help() {
5552
echo " -h, Display this help and exit."
5653
}
5754

58-
while getopts ":b:w:t:f:p:g:l:c:sh" opt; do
55+
while getopts ":b:w:t:f:p:g:c:s:lh" opt; do
5956
case $opt in
6057
b)
6158
BIN_DIR="$OPTARG"
@@ -101,6 +98,9 @@ while getopts ":b:w:t:f:p:g:l:c:sh" opt; do
10198
esac
10299
done
103100

101+
# Ensure that all child processes have exited.
102+
trap 'cleanup' EXIT
103+
104104
if [[ ! -f "$BIN_DIR/tquic_client" || ! -f "$BIN_DIR/tquic_server" ]]; then
105105
echo "Not found tquic_client/tquic_server. Please specify the directory for them by '-b' option."
106106
show_help

0 commit comments

Comments
 (0)