From 2b8f7ed07b01e356abce27e686d66400c0ddeaaa Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 19 Oct 2025 02:56:05 -0500 Subject: more details to finish the job --- interface.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'interface.go') diff --git a/interface.go b/interface.go index 166eb14..4e27dd8 100644 --- a/interface.go +++ b/interface.go @@ -29,6 +29,10 @@ type writeHelpForAutocompleteDebugI interface { WriteHelpForAutocompleteDebug(string, ...string) error } +type writeHelpForSubcommandI interface { + WriteHelpForSubcommand(cmd string) error +} + type writeHelpI interface { WriteHelp() error } @@ -113,6 +117,12 @@ func findAppInfo(tmp interface{}) { helpWriteHelpForAutocompleteDebug() } + if tmp, ok := tmp.(writeHelpForSubcommandI); ok { + me.writeHelpForSubcommandFunc = tmp.WriteHelpForSubcommand + } else { + helpWriteHelpForSubcommand() + } + if tmp, ok := tmp.(writeHelpI); ok { me.writeHelpFunc = tmp.WriteHelp } else { @@ -173,6 +183,18 @@ func findAppInfo(tmp interface{}) { } } +func helpWriteHelpForSubcommand() { + log.Info("") + log.Info("// add this funcgion: this will print the help") + log.Info("func (args) WriteHelpForSubcommand() error {") + log.Info(" me.pp.WriteHelpForSubcommand(os.Stderr, me.argv.Cmd)") + log.Info(" return nil") + log.Info("}") + log.Info("") + log.Info("cp ~/go/src/go.wit.com/apps/forge/argv.template.go .") + panic("copy the argv.template.go file from forge") +} + func helpWriteHelp() { log.Info("") log.Info("// add this funcgion: this will print the help") -- cgit v1.2.3