Skip to content

Commit 06a65fa

Browse files
committed
Create command handler
1 parent 1bb500c commit 06a65fa

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

js/script.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
const shellCommands = [
2-
{
3-
name: "help",
4-
description: "Gets informations about commands",
5-
usage: "help [command]",
6-
handler: helpHandler
7-
}
8-
]
9-
101
console.log("Welcome to the shell!")
11-
let shellInput = document.getElementById("shellinput")
12-
function myFunction() {
13-
console.log("a")
14-
}
2+
window.onload = function () {
3+
document.getElementById("shellinput").value = "";
4+
}
5+
6+
function run(command) {
7+
8+
}
9+
10+
function detectEnter(event,input) {
11+
let keyCode = event.keyCode ? event.keyCode : e.which;
12+
if(keyCode == 13) {
13+
run(input)
14+
document.getElementById("shellinput").value = "";
15+
}
16+
}

0 commit comments

Comments
 (0)