Install shell completion as an optional command

This commit is contained in:
2026-11-03 03:50:12 +00:00
parent 0bed76a6f7
commit fc2f6d5346
9 changed files with 219 additions and 3 deletions

View File

@@ -77,6 +77,9 @@ func (a *App) buildRoutingSnapshot() *routingSnapshot {
flagAliases: a.flagAliases,
discoveryFlags: a.discoveryFlags,
}
if node := a.commands["completion"]; node != nil {
snapshot.completion = node.command.record.completion
}
for _, rule := range a.routingRules {
if rule.record.kind != commandAliasRule {
continue