refactor: cleaning up some old issues and stndardizing.

This commit is contained in:
James Wells 2023-03-20 16:00:15 -07:00
parent b95d3950c5
commit 8640d42132
Signed by: jwells
GPG key ID: 73196D10B8E65666
6 changed files with 190 additions and 113 deletions

View file

@ -7,13 +7,13 @@ import (
"io/ioutil"
"os"
picol "github.com/dragonheim/gagent/src/picol"
picol "github.com/dragonheim/gagent/pkg/picol"
)
var fname = flag.String("f", "", "file name")
// CommandPuts is a simple version of the TCL puts function.
func CommandPuts(i *picol.Interp, argv []string, pd interface{}) (string, error) {
func CommandPuts(i *picol.Interpreter, argv []string, pd interface{}) (string, error) {
if len(argv) != 2 {
return "", fmt.Errorf("wrong number of args for %s %s", argv[0], argv)
}
@ -23,7 +23,7 @@ func CommandPuts(i *picol.Interp, argv []string, pd interface{}) (string, error)
func main() {
flag.Parse()
interp := picol.InitInterp()
interp := picol.NewInterpreter()
interp.RegisterCoreCommands()
interp.RegisterCommand("puts", CommandPuts, nil)