tb Command-like scripts

This commit is contained in:
2025-10-19 23:00:46 +02:00
parent 01da863b8b
commit a96ea5edb6
2 changed files with 48 additions and 21 deletions

View File

@ -134,6 +134,16 @@ void do_mode_interactive(void) {
void main(void) {
PID = proc_getpid();
// short command-like script was supplied
if (argslen() > 0 && args()[0][0] == '.') {
do_file("base:/scripts/rc.tb");
char *path = umalloc(4096);
usprintf(path, "base:/scripts/%s.tb", args()[1]);
do_file(path);
ufree(path);
return;
}
set_config();
do_file("base:/scripts/rc.tb");