summaryrefslogtreecommitdiff
path: root/debugger.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 14:05:33 -0500
committerJeff Carr <[email protected]>2025-09-25 14:05:33 -0500
commit0f8eaec720a5a98d84242b431537dcc4c190c974 (patch)
treedf6f57ba32f7d0e137aa55aa339f3264b07a9409 /debugger.go
parent69943556c09fe6b178afb33a8a6346adb3bd50e7 (diff)
first stab and go-arg Examples()
Diffstat (limited to 'debugger.go')
-rw-r--r--debugger.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/debugger.go b/debugger.go
index 5b1e2a9..5fe28f9 100644
--- a/debugger.go
+++ b/debugger.go
@@ -55,6 +55,12 @@ type AutoFuncd interface {
DoAutoComplete(*Auto)
}
+type Examplesd interface {
+ // Version returns the version string that will be printed on a line by itself
+ // at the top of the help message.
+ Examples() string
+}
+
// Described is the interface that the destination struct should implement to
func findAppInfo(tmp interface{}) {
if tmp, ok := tmp.(Appnamed); ok {
@@ -63,6 +69,12 @@ func findAppInfo(tmp interface{}) {
panic("you need to make the function argv.Appname()")
}
+ if tmp, ok := tmp.(Examplesd); ok {
+ myAuto.examples = tmp.Examples
+ } else {
+ panic("you need to make the function argv.Appname()")
+ }
+
if tmp, ok := tmp.(AutoFuncd); ok {
myAuto.autoFunc = tmp.DoAutoComplete
} else {