tb implement command logging

This commit is contained in:
2025-09-17 22:07:58 +02:00
parent ac1cc172f7
commit ba1c0eedbd
4 changed files with 14 additions and 5 deletions

View File

@ -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);