blob: effc131ed677c67a3d95dc3e0781db81a7ff9d95 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <knob/user.h>
#include <knob/task.h>
#include <knob/block.h>
//TODO: load a user environment file containing a PATH-like setting.
//TODO: have an active disk and/or directory
void main() {
char path_buf[1024 + 4] = "BIN/";
char *const line_buf = path_buf + 4;
while (1) {
tell_user_sz("> ");
ask_user_line_sz(line_buf, 1023);
if (blockequ(line_buf, "exit", 5))
return;
if (try_run_command(path_buf))
yield_task();
else
tell_user_sz("An error occured trying to run that command.\n");
}
}
|