diff options
| author | Jeff Carr <[email protected]> | 2025-10-19 02:56:05 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-19 02:56:05 -0500 |
| commit | 2b8f7ed07b01e356abce27e686d66400c0ddeaaa (patch) | |
| tree | f48a56c8018a48868fc72fec56efeb4162c31a71 /interface.go | |
| parent | 6025b8df8386b165fece9f3eb39ef860fe5028ca (diff) | |
more details to finish the job
Diffstat (limited to 'interface.go')
| -rw-r--r-- | interface.go | 22 |
1 files changed, 22 insertions, 0 deletions
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") |
