summaryrefslogtreecommitdiff
path: root/verifyApplication.go
diff options
context:
space:
mode:
Diffstat (limited to 'verifyApplication.go')
-rw-r--r--verifyApplication.go32
1 files changed, 9 insertions, 23 deletions
diff --git a/verifyApplication.go b/verifyApplication.go
index 18e61d7..b6f86a4 100644
--- a/verifyApplication.go
+++ b/verifyApplication.go
@@ -5,10 +5,10 @@ import "fmt"
// verify the application has the needed function calls defined
func verifyApplication(tmp interface{}) {
// START NEEDED FUNCS // 2025/10/18 (review in a few months)
- if tmp, ok := tmp.(initArgvI); ok {
- me.initArgvFunc = tmp.InitArgv
+ if tmp, ok := tmp.(autoFuncI); ok {
+ me.autoFunc = tmp.DoAutoComplete
} else {
- // panic("you must define in your app the function: (args) func InitArgv() (string, string, string)")
+ panic("you need to make the function argv.DoAutoComplete()")
}
if tmp, ok := tmp.(mustParseI); ok {
@@ -32,17 +32,6 @@ func verifyApplication(tmp interface{}) {
if tmp, ok := tmp.(examplesI); ok {
me.examples = tmp.Examples
}
- if tmp, ok := tmp.(autoFuncI); ok {
- me.autoFunc = tmp.DoAutoComplete
- } else {
- // panic("you need to make the function argv.DoAutoComplete()")
- }
-
- if tmp, ok := tmp.(sendCompletionStringsI); ok {
- me.autoFunc = tmp.SendCompletionStrings
- } else {
- // panic("you need to make the function argv.SendCompletionStrings()")
- }
if tmp, ok := tmp.(exitI); ok {
me.appExit = tmp.Exit
@@ -53,14 +42,16 @@ func verifyApplication(tmp interface{}) {
// WORKING ON START
-type initArgvI interface {
- InitArgv() (string, string, string)
-}
-
type mustParseI interface {
MustParse() error
}
+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() error
+}
+
type initGuiI interface {
// Version returns the version string that will be printed on a line by itself
// at the top of the help message.
@@ -77,11 +68,6 @@ type appnameI interface {
}
// 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(*Argv)
-}
type sendCompletionStringsI interface {
// Version returns the version string that will be printed on a line by itself