Add captured alias declaration types

This commit is contained in:
2026-10-19 17:23:32 +00:00
parent 854426a0c9
commit 7a4efddab8
9 changed files with 297 additions and 21 deletions

View File

@@ -102,7 +102,7 @@ func BenchmarkPerformanceRegistration(b *testing.B) {
if err != nil {
b.Fatal(err)
}
if err := app.Register(commands...); err != nil {
if err := app.Register(performanceDeclarations(commands)...); err != nil {
b.Fatal(err)
}
}
@@ -150,13 +150,21 @@ func performanceNestedCommand(tb testing.TB) (commandkit.Command, []string) {
func performanceApp(tb testing.TB, commands []commandkit.Command) *commandkit.App {
tb.Helper()
app, err := commandkit.New(commandkit.Identity{Name: "bench"}, commands...)
app, err := commandkit.New(commandkit.Identity{Name: "bench"}, performanceDeclarations(commands)...)
if err != nil {
tb.Fatal(err)
}
return app
}
func performanceDeclarations(commands []commandkit.Command) []commandkit.Declaration {
declarations := make([]commandkit.Declaration, len(commands))
for index, command := range commands {
declarations[index] = command
}
return declarations
}
func performanceCommandName(fixture string) string {
if fixture == "wide" {
return "wide00"