summaryrefslogtreecommitdiff
path: root/args.go
blob: 5ff1f58a3836ed14f1f0585f872a83861b954b84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package debugger

// initializes logging and command line options

import (
	arg "github.com/alexflint/go-arg"
	log "go.wit.com/log"
)

var INFO log.LogFlag
var POLL log.LogFlag
var BUG log.LogFlag
var argDebugger ArgsDebugger

// This struct can be used with the go-arg package
type ArgsDebugger struct {
	Debugger bool `arg:"--debugger" help:"open the debugger window"`
}

// returns true if --gui-debug was passed from the command line
func ArgDebug() bool {
	return argDebugger.Debugger
}

func init() {
	arg.Register(&argDebugger)

	INFO.B = false
	INFO.Name = "INFO"
	INFO.Subsystem = "bugger"
	INFO.Desc = "simple debugging Info()"
	INFO.Register()

	POLL.B = false
	POLL.Name = "POLL"
	POLL.Subsystem = "bugger"
	POLL.Desc = "watch the debugger poll things"
	POLL.Register()
}