From bbeee0dd9e8b229ec0a93674fd7c402c82e3fb21 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 17:29:42 -0700 Subject: [PATCH] address feedback Signed-off-by: Phil Prasek --- temporalcli/commandsgen/enrich.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/temporalcli/commandsgen/enrich.go b/temporalcli/commandsgen/enrich.go index afa56d4f..40e84192 100644 --- a/temporalcli/commandsgen/enrich.go +++ b/temporalcli/commandsgen/enrich.go @@ -8,6 +8,9 @@ import ( "strings" ) +// EnrichCommands populates additional fields on Commands +// beyond those read from commands.yml to make it easier +// for docs.go to generate docs func EnrichCommands(m Commands) (Commands, error) { commandLookup := make(map[string]*Command) @@ -41,7 +44,6 @@ func EnrichCommands(m Commands) (Commands, error) { continue } - //fmt.Printf("add child: %s\n", m.CommandList[c.Index].FullName) m.CommandList[c.Parent.Index].Children = append(m.CommandList[c.Parent.Index].Children, &m.CommandList[c.Index]) base := &c @@ -105,13 +107,6 @@ func collectCommandVisitor(c Command, m *Commands) { func sortChildrenVisitor(c *Command) { sort.Slice(c.Children, func(i, j int) bool { - //option to put nested commands at end of the list - /* - if c.Children[i].MaxChildDepth != c.Children[j].MaxChildDepth { - return c.Children[i].MaxChildDepth < c.Children[j].MaxChildDepth - } - */ - return c.Children[i].FullName < c.Children[j].FullName }) for _, command := range c.Children { @@ -136,7 +131,6 @@ func setMaxChildDepthVisitor(c Command, commands *Commands) int { } func getAllOptionUsages(commands Commands) []OptionUsages { - // map[optionName]map[usageSite]OptionUsageSite var optionUsageSitesMap = make(map[string]map[string]OptionUsageSite) // option sets @@ -221,7 +215,6 @@ func getOptionUsagesByOptionDescription(allOptionUsages []OptionUsages) []Option continue } - // map[optionDescription]OptionUsageByOptionDescription optionUsageByOptionDescriptionMap := make(map[string]OptionUsageByOptionDescription) // collate on option description in each usage site