go-xkcdreader/main.go
surtur 4b6e655ebf
All checks were successful
continuous-integration/drone/push Build is passing
use github.com/spf13/cobra for app cmds
* add 'version' command - "go-xkcdreader version" returns a formatted
  version of the app
* test (among other things) that the version in flake.nix matches the
  version hardcoded in app's go code (cmd/version.go)
2022-05-12 15:54:16 +02:00

38 lines
557 B
Go

package main
import (
"fmt"
"git.dotya.ml/wanderer/go-xkcdreader/cmd"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
const appGreeting = "welcome to go-xkcdreader"
var version = cmd.GetShortVersion()
func main() {
cmd.Execute()
fmt.Println("Starting " + cmd.GetAppName() + " " + getVersion())
a := app.New()
w := a.NewWindow(cmd.GetAppName())
w.SetContent(makeGreeting())
w.ShowAndRun()
fmt.Println("Exited")
}
func makeGreeting() *widget.Label {
return widget.NewLabel(appGreeting)
}
func getVersion() string {
return version
}