// SPDX-License-Identifier: GPL-3.0-or-later // krino-gui is a GTK4 window for krino: review a directory's plan and apply // the files you choose, look back over runs and undo them, and write rules. // Every decision is the engine's; see docs/gui-design.md. package main import ( "flag" "fmt" "os" "github.com/diamondburned/gotk4/pkg/gtk/v4" "krino/gui/internal/ui" "krino/internal/engine" ) // version is stamped at build time, as krino's is. var version = "dev" func main() { conf := flag.String("c", "", "use FILE instead of ~/.config/krino/krino.conf") showVersion := flag.Bool("version", false, "print the version and exit") flag.Parse() if *showVersion { fmt.Println("krino-gui " + version) return } e, diags := engine.Load(mainFile(*conf)) if len(diags) > 0 { printDiags(diags) os.Exit(2) } e.CacheDir = cacheDir() app := gtk.NewApplication("xyz.labunix.krino", 0) app.ConnectActivate(func() { ui.NewWindow(app, e).Show() }) if code := app.Run(nil); code != 0 { os.Exit(code) } }