Ed Warnicke | 2d8862c | 2015-12-22 13:23:18 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Ed Warnicke | 33007f5 | 2016-04-04 14:37:21 -0700 | [diff] [blame] | 2 | PREFIX_ARGS="" |
| 3 | CMD_ARGS="" |
| 4 | while [[ $# -gt 0 ]]; do |
| 5 | arg=$1 |
| 6 | shift |
| 7 | case ${arg} in |
| 8 | --prefix|-p) |
| 9 | PREFIX_ARGS="chroot prefix ${1}" |
| 10 | shift |
| 11 | ;; |
| 12 | *) |
| 13 | CMD_ARGS="$CMD_ARGS ${arg}" |
| 14 | ;; |
| 15 | esac |
| 16 | done |
| 17 | |
| 18 | if [ "x${CMD_ARGS}" != "x" ]; then |
| 19 | echo exec ${CMD_ARGS} | vpp_api_test $PREFIX_ARGS | sed 's/vat# //g' |
Ed Warnicke | 7471c6d | 2016-01-18 10:12:53 -0700 | [diff] [blame] | 20 | else |
| 21 | echo -n "vpp# " |
| 22 | while read CMD; do |
Ed Warnicke | 014bdeb | 2016-01-25 18:52:58 -0700 | [diff] [blame] | 23 | if [ "x$CMD" == "xexit" ]; then |
| 24 | exit |
| 25 | elif [ "x$CMD" != "x" ]; then |
Ed Warnicke | 33007f5 | 2016-04-04 14:37:21 -0700 | [diff] [blame] | 26 | echo exec $CMD | vpp_api_test $PREFIX_ARGS| sed 's/vat# //g' |
Ed Warnicke | 014bdeb | 2016-01-25 18:52:58 -0700 | [diff] [blame] | 27 | fi |
| 28 | echo -n "vpp# " |
Ed Warnicke | 7471c6d | 2016-01-18 10:12:53 -0700 | [diff] [blame] | 29 | done |
| 30 | fi |