1
0
mirror of https://github.com/robertkrimen/otto synced 2025-09-28 18:45:22 +08:00

Add underscore to the commandline

This commit is contained in:
Robert Krimen 2012-10-10 15:58:28 -07:00
parent 5958af6914
commit c2851c6b6e

View File

@ -6,8 +6,11 @@ import (
"io/ioutil"
"os"
"github.com/robertkrimen/otto"
"github.com/robertkrimen/otto/underscore"
)
var underscoreFlag *bool = flag.Bool("underscore", true, "Load underscore into the runtime environment")
func main() {
flag.Parse()
var script []byte
@ -26,6 +29,9 @@ func main() {
os.Exit(64)
}
}
if !*underscoreFlag {
underscore.Disable()
}
Otto := otto.New()
_, err = Otto.Run(string(script))
if err != nil {