From c2851c6b6ec2be65e9c09b31d64915049b62311a Mon Sep 17 00:00:00 2001 From: Robert Krimen Date: Wed, 10 Oct 2012 15:58:28 -0700 Subject: [PATCH] Add underscore to the commandline --- otto/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/otto/main.go b/otto/main.go index 96820c2..6f4d0fe 100644 --- a/otto/main.go +++ b/otto/main.go @@ -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 {