Fix vppctl to cope with vpe -> vpp transition
[vpp.git] / vpp-api-test / scripts / vppctl
old mode 100644 (file)
new mode 100755 (executable)
index b789493..88b48d8
@@ -1,2 +1,14 @@
 #!/bin/bash
-echo exec ${@} | vpe_api_test | sed 's/vat# //g'
+if [ $# -gt 0 ]; then
+    echo exec ${@} | vpp_api_test | sed 's/vat# //g'
+else
+    echo -n "vpp# "
+    while read CMD; do
+        if [ "x$CMD" == "xexit" ]; then
+            exit
+        elif [ "x$CMD" != "x" ]; then
+            echo exec $CMD | vpp_api_test | sed 's/vat# //g'
+        fi
+        echo -n "vpp# "
+    done
+fi