summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-18 03:21:39 -0500
committerJeff Carr <[email protected]>2025-10-18 03:21:39 -0500
commitd68c81c1add8b09aed8b8a19c6b61610a9ff8605 (patch)
tree8e16849a0e3d57663e930201158d2181fafced8b /argv.go
parent4fee86a80f84dd7c591935c7c5d7013adbab0b67 (diff)
switching to the new 'argv'
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go28
1 files changed, 24 insertions, 4 deletions
diff --git a/argv.go b/argv.go
index 59ad7ff..83e333a 100644
--- a/argv.go
+++ b/argv.go
@@ -1,5 +1,10 @@
package main
+import (
+ "go.wit.com/dev/alexflint/arg"
+ "go.wit.com/gui"
+)
+
/*
this parses the command line arguements
this enables command line options from other packages like 'gui' and 'log'
@@ -7,16 +12,31 @@ package main
var argv args
+var APPNAME string = "basicwindow"
+
+// sent via -ldflags
+var VERSION string
+var BUILDTIME string
+
+// define your command line arguements here
type args struct {
Demo string `arg:"positional" help:"this is just a demo"`
}
+func (args) InitArgv() (string, string, string) {
+ // "basicwindow", "2025/10/18", "v0.2.0"
+ return APPNAME, BUILDTIME, VERSION
+}
+
+func (args) InitGui() error {
+ // panic("got here")
+ arg.Register(&gui.ArgvGui)
+ // me.myGui = gui.New()
+ return nil
+}
+
func (a args) Description() string {
return `
This basicwindow example demonstrates multiple windows
`
}
-
-func (args) Version() string {
- return "basicwindow " + VERSION
-}