Install shared reporting flags

This commit is contained in:
2026-10-26 02:50:54 +00:00
parent 6ba9338c0a
commit f3bd6dc2ae
10 changed files with 226 additions and 10 deletions

View File

@@ -127,10 +127,14 @@ func indexCanonicalNodes(roots map[string]*canonicalNode) map[string]*canonicalN
}
func helpFlagSpellings() map[string]capturedFlagSpelling {
flags := make(map[string]capturedFlagSpelling, 2)
flags := make(map[string]capturedFlagSpelling, 2+len(commandmeta.ReportingFlags()))
for _, spelling := range []capturedFlagSpelling{{name: "help"}, {name: "h", short: true}} {
flags[flagSpellingKey(spelling)] = spelling
}
for _, metadata := range commandmeta.ReportingFlags() {
spelling := capturedFlagSpelling{name: metadata.Name}
flags[flagSpellingKey(spelling)] = spelling
}
return flags
}