summaryrefslogtreecommitdiff
path: root/interface.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-13 09:53:15 -0500
committerJeff Carr <[email protected]>2025-10-13 09:53:15 -0500
commitd4b928f7bb8f66afc31a95fa4552b8fd8fba3712 (patch)
tree689a40f652bd2f784eb1e028340282bdb2f5739b /interface.go
parent915ea4f648f8639cb1fc4111fa49ff298ea79441 (diff)
calls back to the apps' main/argv.go but what next?
Diffstat (limited to 'interface.go')
-rw-r--r--interface.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/interface.go b/interface.go
index 0dad2ac..8363a63 100644
--- a/interface.go
+++ b/interface.go
@@ -33,6 +33,12 @@ type examplesI interface {
Examples() string
}
+type guiI interface {
+ // Version returns the version string that will be printed on a line by itself
+ // at the top of the help message.
+ ArgvGui() error
+}
+
type exitI interface {
// allows a custom app Exit()
Exit()
@@ -49,13 +55,15 @@ func findAppInfo(tmp interface{}) {
if tmp, ok := tmp.(buildtimeI); ok {
myAuto.buildtime = tmp.Buildtime
} else {
- // panic("you need to make the function argv.Appname()")
+ // panic("your app is missing (argv) func Buildtime() (string, string)")
}
if tmp, ok := tmp.(examplesI); ok {
myAuto.examples = tmp.Examples
- } else {
- // panic("you need to make the function argv.Appname()")
+ }
+
+ if tmp, ok := tmp.(guiI); ok {
+ myAuto.guiFunc = tmp.ArgvGui
}
if tmp, ok := tmp.(autoFuncI); ok {