diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-20 14:50:12 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-20 14:50:12 -0400 |
commit | fadd46012c9974931add6c36e69636d3cbc6906f (patch) | |
tree | d1af6084772830074be18cf7a9dd93c2ec3d3f59 /src/user/highway/line.c | |
parent | de20d7430df08731d9108acb83e1234ba7f1fe16 (diff) | |
download | portland-os-fadd46012c9974931add6c36e69636d3cbc6906f.tar.gz |
history when getting line from user in knob
Diffstat (limited to 'src/user/highway/line.c')
-rw-r--r-- | src/user/highway/line.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/user/highway/line.c b/src/user/highway/line.c index 40dccfa..b5a54c5 100644 --- a/src/user/highway/line.c +++ b/src/user/highway/line.c @@ -57,25 +57,28 @@ void run_line(const char *original_line) { const char *space; for (space = line; *space && (*space != ' '); ++space) ; - if (blockequ(line, "source", space - line)) + if (blockequ(line, "source ", 7)) source(space + 1); - else if (blockequ(line, "set", space - line)) + else if (blockequ(line, "set ", 4)) set(space + 1); - else if (blockequ(line, "echo", space - line)) { + else if (blockequ(line, "echo ", 5)) { tell_user_sz(space + 1); tell_user_sz("\n"); } - else if (blockequ(line, "vars", space - line)) + else if (blockequ(line, "vars", 5)) dump_vars(); - else if (blockequ(line, "quit", space - line)) + else if (blockequ(line, "quit", 5)) __pcrt_quit(); - else if (blockequ(line, "help", space - line)) + else if (blockequ(line, "clear", 6)) + _clear_screen(); + else if (blockequ(line, "help", 5)) tell_user_sz("Highway is a command shell for Portland OS. It includes variables and a couple\n" "of pseudo-commands. Variables are addressed by surrounding with \"$\". The\n" "following list shows each of the pseudo-commands.\n\n" " source FILE run each command in FILE\n" - " set VAR VALUE set $VAR$ to VALUE\n" + " clear clear the screen\n" " echo STRING print STRING\n" + " set VAR VALUE set $VAR$ to VALUE\n" " vars dump variables\n" " quit exit highway\n" " help show this\n"); |