summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--complete.go6
-rw-r--r--debugger.go6
2 files changed, 8 insertions, 4 deletions
diff --git a/complete.go b/complete.go
index e82510b..1607fe1 100644
--- a/complete.go
+++ b/complete.go
@@ -327,7 +327,11 @@ func Bash(dest any) *Auto {
// pb.Debugf("DEBUG: NO MATCH last='%s' found key '%s' = %s", pb.Last, key, val)
}
}
- myAuto.autoFunc(pb) // run the autocomplete function the user made for their application
+ if myAuto.autoFunc == nil {
+ pb.SubCommand(pb.Argv...)
+ } else {
+ myAuto.autoFunc(pb) // run the autocomplete function the user made for their application
+ }
if pb.Debug {
// TODO:
// check here to see if there was any completion text sent
diff --git a/debugger.go b/debugger.go
index 5fe28f9..238580f 100644
--- a/debugger.go
+++ b/debugger.go
@@ -66,18 +66,18 @@ func findAppInfo(tmp interface{}) {
if tmp, ok := tmp.(Appnamed); ok {
myAuto.appName = tmp.Appname()
} else {
- panic("you need to make the function argv.Appname()")
+ panic("you must define in your app the function: (argv) func Appname() string")
}
if tmp, ok := tmp.(Examplesd); ok {
myAuto.examples = tmp.Examples
} else {
- panic("you need to make the function argv.Appname()")
+ // panic("you need to make the function argv.Appname()")
}
if tmp, ok := tmp.(AutoFuncd); ok {
myAuto.autoFunc = tmp.DoAutoComplete
} else {
- panic("you need to make the function argv.DoAutoComplete()")
+ // panic("you need to make the function argv.DoAutoComplete()")
}
}