summaryrefslogtreecommitdiff
path: root/interface.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-12 01:34:03 -0500
committerJeff Carr <[email protected]>2025-10-12 01:34:03 -0500
commitd04e274fc0d0a6ae11add130cf5c40d5eedb2570 (patch)
treeb1a5175fd6253d1bf8a82349c3352ea2f87a6da6 /interface.go
parent391de1095ed5663ec224bcc1cfaa17bcba4c5b25 (diff)
more house cleaning
Diffstat (limited to 'interface.go')
-rw-r--r--interface.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/interface.go b/interface.go
index 09461b1..0dad2ac 100644
--- a/interface.go
+++ b/interface.go
@@ -10,12 +10,19 @@ type appnameI interface {
Appname() string
}
+// deprecate
type autoFuncI interface {
// Version returns the version string that will be printed on a line by itself
// at the top of the help message.
DoAutoComplete(*Auto)
}
+type sendCompletionStringsI interface {
+ // Version returns the version string that will be printed on a line by itself
+ // at the top of the help message.
+ SendCompletionStrings(*Auto)
+}
+
type buildtimeI interface {
Buildtime() (string, string)
}
@@ -27,8 +34,7 @@ type examplesI interface {
}
type exitI interface {
- // Version returns the version string that will be printed on a line by itself
- // at the top of the help message.
+ // allows a custom app Exit()
Exit()
}
@@ -58,6 +64,12 @@ func findAppInfo(tmp interface{}) {
// panic("you need to make the function argv.DoAutoComplete()")
}
+ if tmp, ok := tmp.(sendCompletionStringsI); ok {
+ myAuto.autoFunc = tmp.SendCompletionStrings
+ } else {
+ // panic("you need to make the function argv.DoAutoComplete()")
+ }
+
if tmp, ok := tmp.(exitI); ok {
myAuto.appExit = tmp.Exit
} else {