generated from rnentjes/kotlin-server-web-undertow
Add debug println statements in Shell.execCommand and adjust ConsoleView input handling
This commit is contained in:
@@ -77,6 +77,7 @@ object Shell {
|
||||
}
|
||||
|
||||
fun execCommand(command: String, computer: MonTanaMiniComputer) {
|
||||
println("Exec: $command")
|
||||
val tokens = MTMCTokenizer(command, "#")
|
||||
try {
|
||||
val identifier = tokens.matchAndConsume(MTMCToken.TokenType.IDENTIFIER)
|
||||
@@ -101,6 +102,7 @@ object Shell {
|
||||
if (isCommand(cmd)) {
|
||||
COMMANDS[cmd.lowercase()]!!.exec(tokens, computer)
|
||||
} else {
|
||||
println("Executing: $command")
|
||||
tokens.reset()
|
||||
val asm = mutableListOf<MTMCToken>()
|
||||
asm.addAll(tokens.tokens)
|
||||
|
||||
@@ -53,10 +53,10 @@ class ConsoleView(
|
||||
|
||||
private fun handleCommand() {
|
||||
history.add(input)
|
||||
input = ""
|
||||
|
||||
Shell.execCommand(input, computer)
|
||||
|
||||
input = ""
|
||||
mainView.requestUpdate()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user