summaryrefslogtreecommitdiffstats
path: root/scripts/trex-console
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/trex-console')
-rwxr-xr-xscripts/trex-console18
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