blob: f4062b64f204c58d6f6c506cd0e3bcca9326389c [file] [log] [blame]
Ed Warnicke2d8862c2015-12-22 13:23:18 -07001#!/bin/bash
Ed Warnicke33007f52016-04-04 14:37:21 -07002PREFIX_ARGS=""
3CMD_ARGS=""
4while [[ $# -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
16done
17
18if [ "x${CMD_ARGS}" != "x" ]; then
19 echo exec ${CMD_ARGS} | vpp_api_test $PREFIX_ARGS | sed 's/vat# //g'
Ed Warnicke7471c6d2016-01-18 10:12:53 -070020else
21 echo -n "vpp# "
22 while read CMD; do
Ed Warnicke014bdeb2016-01-25 18:52:58 -070023 if [ "x$CMD" == "xexit" ]; then
24 exit
25 elif [ "x$CMD" != "x" ]; then
Ed Warnicke33007f52016-04-04 14:37:21 -070026 echo exec $CMD | vpp_api_test $PREFIX_ARGS| sed 's/vat# //g'
Ed Warnicke014bdeb2016-01-25 18:52:58 -070027 fi
28 echo -n "vpp# "
Ed Warnicke7471c6d2016-01-18 10:12:53 -070029 done
30fi