(U)PARSE + CALL: Controlling Of Interactive CLI Apps

A long time ago (e.g. college), I used something in Tcl called EXPECT...which was a great way of driving interactive console applications.

You'd specify the patterns you wanted to wait on (that came from the app's stdout), and script the responses to be fed to stdin, in an interactive fashion.

Today people think a lot more about exposing functionality through APIs (with whatever Java or XML and such). So it's more rare that you have to resort to writing "stdio robots".

But it's a pretty easy-to-absorb test case, and could be a real showcase for UPARSE...as well as a good challenge for a renewed PORT! model.

I found this code from @Brett on Trello, where the need for an R3 version of CALL was being articulated. It gives some EXPECT-like functionality:

This seems like a good domain to build some simple-but-impressive demos for... in the "layperson could have built this robot" sense (if we can push it to that point).

3 Likes