tb implement command logging
This commit is contained in:
@ -150,7 +150,7 @@ bool interp_readline(char *data, const char **bgptr, const char **endptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool interp_runstring(const char *string, InterpResult **res) {
|
||||
bool interp_runstring(const char *string, InterpResult **res, bool logcmds) {
|
||||
*res = &RES;
|
||||
string_memset(RES.errmsg, 0, sizeof(RES.errmsg));
|
||||
|
||||
@ -160,6 +160,11 @@ bool interp_runstring(const char *string, InterpResult **res) {
|
||||
interp_readline((char *)string, NULL, NULL);
|
||||
while (interp_readline(NULL, &bg, &end)) {
|
||||
size_t linelen = end - bg;
|
||||
|
||||
if (logcmds) {
|
||||
uprintf("+ %.*s\n", (int)linelen, bg);
|
||||
}
|
||||
|
||||
Tokenizer tz = {0};
|
||||
tz_init(&tz, bg, linelen);
|
||||
|
||||
|
Reference in New Issue
Block a user