diff options
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 { |
