ari.lt/content/js/term/cmd.js
Ari Archer 8dc1a5378e personal : makeover of index and 404, add pages api
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2023-04-06 01:55:01 +03:00

31 lines
648 B
JavaScript

"use strict";
function cmd_help() {
let ul = document.createElement("ul");
Object.keys(window)
.filter((name) => name.startsWith("cmd_"))
.map((name) => name.slice(4))
.forEach((cmd) => mkelem("li", cmd, ul));
return [
"congratulations, you are now in the ari-web terminal\nheres some commands : ",
ul,
];
}
function cmd_exit(_, hist, term_wrap) {
term_wrap.style.display = "none";
hist.innerHTML = "";
return [];
}
function cmd_reboot() {
window.location.reload();
return ["rebooting ..."];
}
function cmd_clear(_, hist) {
hist.innerHTML = "";
return [];
}