From 0f8eaec720a5a98d84242b431537dcc4c190c974 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 25 Sep 2025 14:05:33 -0500 Subject: first stab and go-arg Examples() --- debugger.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'debugger.go') 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 { -- cgit v1.2.3