-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.go
56 lines (43 loc) · 1.24 KB
/
main.go
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//go:build binary
// +build binary
package main
import (
"fmt"
"github.com/coyim/gotk3adapter/gdka"
"github.com/coyim/gotk3adapter/gliba"
"github.com/coyim/gotk3adapter/gtka"
"github.com/digitalautonomy/wahay/config"
"github.com/digitalautonomy/wahay/gui"
log "github.com/sirupsen/logrus"
)
// BuildCommit contains which commit the build was based on
var BuildCommit = "UNKNOWN"
// BuildShortCommit contains which commit in short format the build was based on
var BuildShortCommit = "UNKNOWN"
// BuildTag contains which tag - if any - the build was based on
var BuildTag = "(no tag)"
// BuildTimestamp contains the timestamp in Ecuador time zone when the build was made
var BuildTimestamp = "UNKNOWN"
func main() {
config.ProcessCommandLineArguments()
if *config.Version {
fmt.Printf("Wahay (commit: %s (%s) tag: %s built: %s)\n", BuildShortCommit, BuildCommit, BuildTag, BuildTimestamp)
return
}
initLogging()
runClient()
}
func initLogging() {
log.SetLevel(log.InfoLevel)
if *config.Debug {
log.SetLevel(log.DebugLevel)
}
if *config.Trace {
log.SetLevel(log.TraceLevel)
}
log.SetReportCaller(*config.DebugFunctionCalls)
}
func runClient() {
g := gui.CreateGraphics(gtka.Real, gliba.Real, gdka.Real)
gui.NewGTK(g).Loop()
}