diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-27 19:06:48 +0300 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-27 19:06:48 +0300 |
commit | 68ed79b989008006897108c7978d5c65fef47711 (patch) | |
tree | 43ed82b63015777369e8db71ca247f512a9de467 /scripts/trex-console | |
parent | fbf1d1f4387566e964b2775e79e4e71c87dc3f8d (diff) |
fix find_python usage
Diffstat (limited to 'scripts/trex-console')
-rwxr-xr-x | scripts/trex-console | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/trex-console b/scripts/trex-console index ea253fdd..0fcf656a 100755 --- a/scripts/trex-console +++ b/scripts/trex-console @@ -1,9 +1,23 @@ #!/bin/bash -source find_python.sh +INPUT_ARGS=$@ + +if [[ $@ =~ '--python2' ]]; then + INPUT_ARGS=${@//--python2/} + source find_python.sh --python2 +fi + +if [[ $@ =~ '--python3' ]]; then + INPUT_ARGS=${@//--python3/} + source find_python.sh --python3 +fi + +if [ -z "$PYTHON" ]; then + source find_python.sh +fi export PYTHONPATH=automation/trex_control_plane/stl printf "\nUsing '$PYTHON' as Python interpeter\n\n" -$PYTHON -m console.trex_console $@ +$PYTHON -m console.trex_console $INPUT_ARGS |