#!/bin/bash

INPUT_ARGS=$@

if [[ $@ =~ '--python2' ]]; then
    INPUT_ARGS=${@//--python2/}
    source /usr/share/trex-core/scripts/find_python.sh --python2
fi

if [[ $@ =~ '--python3' ]]; then
    INPUT_ARGS=${@//--python3/}
    source /usr/share/trex-core/scripts/find_python.sh --python3
fi

if [ -z "$PYTHON" ]; then
    source /usr/share/trex-core/scripts/find_python.sh
fi

export PYTHONPATH=/usr/share/trex-core/scripts/automation/trex_control_plane/interactive
$PYTHON -m trex.astf.sim -p $PWD $INPUT_ARGS
