From d04e274fc0d0a6ae11add130cf5c40d5eedb2570 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 01:34:03 -0500 Subject: more house cleaning --- interface.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'interface.go') 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 { -- cgit v1.2.3