diff options
| author | Jeff Carr <[email protected]> | 2025-10-12 00:56:11 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-12 00:56:11 -0500 |
| commit | 07eccc7f591fca0914a94782f4b5c8ba973d14d1 (patch) | |
| tree | b7d8e1c14cd4f44e26d0a12b698852796b78e93b /debugger.go | |
| parent | 9ad9c25bd36643e954fe0a3a1e5a2ba3ec92151b (diff) | |
Exit() callback
Diffstat (limited to 'debugger.go')
| -rw-r--r-- | debugger.go | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/debugger.go b/debugger.go index 7f20819..5d1298a 100644 --- a/debugger.go +++ b/debugger.go @@ -40,54 +40,3 @@ func Debugger() { CHAN = log.NewFlag("CHAN", true, full, short, "chan() test code output") WARN = log.NewFlag("WARN", true, full, short, "should warn the user") } - -// Versioned is the interface that the destination struct should implement to -// make a version string appear at the top of the help message. -type Appnamed interface { - // Version returns the version string that will be printed on a line by itself - // at the top of the help message. - Appname() string -} - -type AutoFuncd interface { - // Version returns the version string that will be printed on a line by itself - // at the top of the help message. - 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. - Examples() string -} - -// Described is the interface that the destination struct should implement to -func findAppInfo(tmp interface{}) { - if tmp, ok := tmp.(Appnamed); ok { - myAuto.appName = tmp.Appname() - } else { - 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 { - // 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()") - } -} |
