#include #include #include #include "JSystem/JShell.hh" #include "JSystem/JSystemToolkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test shell I/O (class JSYSTEM::JShell). * \author mdejong */ int main(int argc, char **argv) { using namespace std; int debug; try { JParser<> zap("Example program to test shell I/O."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; JShell shell; for (string buffer; shell; ) { cout << "> " << flush; getline(cin, buffer); if (buffer != "" && buffer != "exit") { shell << buffer << endl; while (shell.getline(buffer)) { cout << buffer << endl; } } else { break; } } }