summaryrefslogtreecommitdiff
path: root/interface.go
diff options
context:
space:
mode:
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 {