Cache immutable command bridge metadata
This commit is contained in:
@@ -17,6 +17,13 @@ func (a *App) bridgeTree() *internalcobra.Command {
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
if a.commandTree == nil {
|
||||
a.commandTree = a.buildBridgeTree()
|
||||
}
|
||||
return a.commandTree
|
||||
}
|
||||
|
||||
func (a *App) buildBridgeTree() *internalcobra.Command {
|
||||
root := &internalcobra.Command{Name: a.identity.Name}
|
||||
names := make([]string, 0, len(a.commands))
|
||||
for name, node := range a.commands {
|
||||
|
||||
Reference in New Issue
Block a user