28 #include <readline/readline.h> 29 #include <readline/history.h> 43 LocalMinsky::~LocalMinsky() {}
52 replace(x.begin(),x.end(),
'.',
'/');
58 if (buffer[0]==
'#')
return;
61 cerr << buffer <<
"command doesn't starts with /"<<endl;
67 cout <<
toREST(i.first) << endl;
73 auto n=buffer.find(
' ');
74 json_pack_t jin(json5_parser::mValue::null);
80 cmd=buffer.substr(0,n);
81 read(buffer.substr(n),jin);
85 replace(cmd.begin(), cmd.end(),
'/',
'.');
90 catch (
const std::exception& ex)
92 cerr <<
"Exception: "<<ex.what() << endl;
96 int main(
int argc,
const char* argv[])
99 const bool batch=argc>1 && argv[1]==string(
"-batch");
107 while (getline(cin,buffer))
110 while ((c=readline(
"cmd>"))!=
nullptr)
112 const string buffer=c;
114 if (strlen(c)) add_history(c);
118 while (getline(cin,buffer))
void processBuffer(const string &buffer)
void doOneEvent(bool idletasksOnly)
checks if any GUI events are waiting, and proces an event if so
void commandHook(const std::string &command, const RP &args)
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
int main(int argc, const char *argv[])
RAII set the minsky object to a different one for the current scope.