Skip to content

Commit

Permalink
*HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Aug 7, 2021
1 parent 8cc19a2 commit e6ccf6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 15 additions & 0 deletions osCLI.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"os/exec"
"strconv"
"strings"
)
Expand Down Expand Up @@ -35,8 +36,22 @@ func execOSCLI(env *environment) {
switch command {
case "*HELP":
msg = "\nbbz - Acorn MOS for 6502 adaptation layer, https://github.com/ivanizag/bbz\n"

case "*QUIT":
env.stop = true

case "*HOST":
if len(params) == 0 {
env.raiseError(1, "Command missing for *HOST")
} else {
cmd := exec.Command(params[0], params[1:]...)
stdout, err := cmd.Output()
if err != nil {
env.raiseError(1, err.Error())
}
fmt.Println(string(stdout))
}

case "*FX":
// Parse *FX args
if len(params) == 0 || len(params) > 3 {
Expand Down
2 changes: 0 additions & 2 deletions osWord.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"strings"
"time"
)

Expand All @@ -27,7 +26,6 @@ func execOSWORD(env *environment) {
return
}
line := env.in.Text()
line = strings.ToUpper(line)

// TODO: check max size
buffer := env.peekWord(xy)
Expand Down

0 comments on commit e6ccf6b

Please sign in to comment.