Skip to content

Commit 5e844ec

Browse files
author
Alex Levinson
committed
debugging some windows build failures
1 parent 6ae3dd2 commit 5e844ec

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

cmd/gscript/main.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var (
3737
compressBinary = false
3838
enableLogging = false
3939
enableDebug = false
40+
retainBuildDir = false
4041
)
4142

4243
func main() {
@@ -134,6 +135,12 @@ func main() {
134135
Usage: "Run a Genesis script (Careful, don't infect yourself!).",
135136
Action: RunScript,
136137
},
138+
{
139+
Name: "trace",
140+
Aliases: []string{"a"},
141+
Usage: "Show command line options",
142+
Action: TraceScript,
143+
},
137144
}
138145

139146
sort.Sort(cli.FlagsByName(app.Flags))
@@ -142,6 +149,15 @@ func main() {
142149
app.Run(os.Args)
143150
}
144151

152+
func TraceScript(c *cli.Context) error {
153+
files := c.Args()
154+
for _, f := range files {
155+
fmt.Printf("Argument: %s\n", f)
156+
fmt.Printf("Base: %s\n", filepath.Base(f))
157+
}
158+
return nil
159+
}
160+
145161
func TestScript(c *cli.Context) error {
146162
logger := logrus.New()
147163
logger.Formatter = &logging.GSEFormatter{}

compiler/compiler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sync"
1212
"text/template"
1313

14+
"github.com/davecgh/go-spew/spew"
1415
"github.com/gen0cide/gscript/engine"
1516
"github.com/gen0cide/gscript/logging"
1617
"github.com/sirupsen/logrus"
@@ -153,6 +154,7 @@ func (c *Compiler) compileMacros() {
153154

154155
func (c *Compiler) writeScript() {
155156
for _, vm := range c.VMs {
157+
c.Logger.Infof("Script Information: %s", spew.Sdump(vm))
156158
if _, err := os.Stat(vm.ScriptFile); os.IsNotExist(err) {
157159
c.Logger.Fatalf("Genesis Script does not exist: %s", vm.ScriptFile)
158160
}

compiler/options.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package compiler
2+
3+
type Options struct {
4+
Scripts []string
5+
Outfile string
6+
OS string
7+
Arch string
8+
ShowSource bool
9+
CompressionEnabled bool
10+
LoggingEnabled bool
11+
PreserveBuildDir bool
12+
}

0 commit comments

Comments
 (0)