88 "strings"
99)
1010
11+ // EnrichCommands populates additional fields on Commands
12+ // beyond those read from commands.yml to make it easier
13+ // for docs.go to generate docs
1114func EnrichCommands (m Commands ) (Commands , error ) {
1215 commandLookup := make (map [string ]* Command )
1316
@@ -41,7 +44,6 @@ func EnrichCommands(m Commands) (Commands, error) {
4144 continue
4245 }
4346
44- //fmt.Printf("add child: %s\n", m.CommandList[c.Index].FullName)
4547 m .CommandList [c .Parent .Index ].Children = append (m .CommandList [c .Parent .Index ].Children , & m .CommandList [c .Index ])
4648
4749 base := & c
@@ -105,13 +107,6 @@ func collectCommandVisitor(c Command, m *Commands) {
105107
106108func sortChildrenVisitor (c * Command ) {
107109 sort .Slice (c .Children , func (i , j int ) bool {
108- //option to put nested commands at end of the list
109- /*
110- if c.Children[i].MaxChildDepth != c.Children[j].MaxChildDepth {
111- return c.Children[i].MaxChildDepth < c.Children[j].MaxChildDepth
112- }
113- */
114-
115110 return c .Children [i ].FullName < c .Children [j ].FullName
116111 })
117112 for _ , command := range c .Children {
@@ -136,7 +131,6 @@ func setMaxChildDepthVisitor(c Command, commands *Commands) int {
136131}
137132
138133func getAllOptionUsages (commands Commands ) []OptionUsages {
139- // map[optionName]map[usageSite]OptionUsageSite
140134 var optionUsageSitesMap = make (map [string ]map [string ]OptionUsageSite )
141135
142136 // option sets
@@ -221,7 +215,6 @@ func getOptionUsagesByOptionDescription(allOptionUsages []OptionUsages) []Option
221215 continue
222216 }
223217
224- // map[optionDescription]OptionUsageByOptionDescription
225218 optionUsageByOptionDescriptionMap := make (map [string ]OptionUsageByOptionDescription )
226219
227220 // collate on option description in each usage site
0 commit comments