diff options
Diffstat (limited to 'interface.go')
| -rw-r--r-- | interface.go | 16 |
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 { |
