From d4b928f7bb8f66afc31a95fa4552b8fd8fba3712 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 13 Oct 2025 09:53:15 -0500 Subject: calls back to the apps' main/argv.go but what next? --- interface.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'interface.go') 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 { -- cgit v1.2.3