From 435b9fdee2f51170aacf21f14a0118c89c84e166 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 2 Oct 2025 18:35:52 -0500 Subject: make a smart argv() function --- debugger.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'debugger.go') diff --git a/debugger.go b/debugger.go index 238580f..7f20819 100644 --- a/debugger.go +++ b/debugger.go @@ -55,6 +55,10 @@ type AutoFuncd interface { DoAutoComplete(*Auto) } +type Buildtimed interface { + Buildtime() (string, string) +} + type Examplesd interface { // Version returns the version string that will be printed on a line by itself // at the top of the help message. @@ -69,6 +73,12 @@ func findAppInfo(tmp interface{}) { panic("you must define in your app the function: (argv) func Appname() string") } + if tmp, ok := tmp.(Buildtimed); ok { + myAuto.buildtime = tmp.Buildtime + } else { + // panic("you need to make the function argv.Appname()") + } + if tmp, ok := tmp.(Examplesd); ok { myAuto.examples = tmp.Examples } else { -- cgit v1.2.3