diff options
| author | Jeff Carr <[email protected]> | 2025-10-18 05:10:17 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-18 05:10:17 -0500 |
| commit | 8d1a704d6f41b5f08aabc276d1476266f51c5b63 (patch) | |
| tree | 46c6f81796b9ef351976debf2d8fe216fff56962 /interface.go | |
| parent | 7ef1d9192c366423f5e6bf2b68946aac5cdea336 (diff) | |
move go-args back to the application code
Diffstat (limited to 'interface.go')
| -rw-r--r-- | interface.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/interface.go b/interface.go index d1d3aec..72c1b50 100644 --- a/interface.go +++ b/interface.go @@ -11,6 +11,12 @@ type initArgvI interface { InitArgv() (string, string, string) } +type mustParseI interface { + // Version returns the version string that will be printed on a line by itself + // at the top of the help message. + MustParse() error +} + type initGuiI interface { // Version returns the version string that will be printed on a line by itself // at the top of the help message. @@ -69,6 +75,12 @@ func findAppInfo(tmp interface{}) { panic("you must define in your app the function: (args) func InitArgv() (string, string, string)") } + if tmp, ok := tmp.(mustParseI); ok { + me.mustParseFunc = tmp.MustParse + } else { + panic("you must define in your app the function: func (args) MustParse() error") + } + if tmp, ok := tmp.(initGuiI); ok { me.initGuiFunc = tmp.InitGui if err := tmp.InitGui(); err != nil { |
