Commit 6dbd1d8a authored by Roman Haefeli's avatar Roman Haefeli
Browse files

add --help section

parent afb6192d
...@@ -15,6 +15,7 @@ VALIDSAMPLERATELIST="22050 32000 44100 48000 88200 96000 192000" ...@@ -15,6 +15,7 @@ VALIDSAMPLERATELIST="22050 32000 44100 48000 88200 96000 192000"
VALIDBLOCKSIZELIST="64 128 256 512 1024 2048 4096" VALIDBLOCKSIZELIST="64 128 256 512 1024 2048 4096"
# Parse cmdline arguments # Parse cmdline arguments
help=false
while [ $# -gt 0 ] while [ $# -gt 0 ]
do do
case "$1" in case "$1" in
...@@ -25,6 +26,7 @@ do ...@@ -25,6 +26,7 @@ do
-i|--instances) NUMOFINSTANCES="$2"; shift;; -i|--instances) NUMOFINSTANCES="$2"; shift;;
-c|--client) CLIENTOF="$2"; shift;; -c|--client) CLIENTOF="$2"; shift;;
-d|--duration) DURATION="$2"; shift;; -d|--duration) DURATION="$2"; shift;;
-h|--help) help=true;;
-*) printerr "$SCRIPTNAME: error - unrecognized option '$1'" -*) printerr "$SCRIPTNAME: error - unrecognized option '$1'"
printerr "use '$SCRIPTNAME --help' to get a list of available options" printerr "use '$SCRIPTNAME --help' to get a list of available options"
exit 1;; exit 1;;
...@@ -33,6 +35,40 @@ do ...@@ -33,6 +35,40 @@ do
shift shift
done done
# show help
if $help
then
cat << EOF
$SCRIPTNAME
------------
Tool for testing network connection for Telematic Performances. It's
basically a wrapper around iperf3.
The tool emulates the payload of one or many jacktrip connections
and reports jitter and lost packages.
For a given number of channels and bitres, you may want to tweak
the buffersize and test what works best for the current network
connection.
CMDLINE OPTIONS:
-n|--numofchannels INT number of channels
-b|--bitres INT bit resolution (8, 16, 24, 32)
-r|--samplerate INT samplerate
-s|--blocksize INT blocksize
-i|--instances INT run INT number of clients simultaneously
-c|--client HOST set the host to connect to
-d|--duration INT duration of a test in seconds
-h|--help show this help
EOF
exit
fi
# check BITRES # check BITRES
if [[ ! $VALIDBITRESLIST =~ (^|[[:space:]])$BITRES($|[[:space:]]) ]] if [[ ! $VALIDBITRESLIST =~ (^|[[:space:]])$BITRES($|[[:space:]]) ]]
then then
......
Supports Markdown
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