Add captured alias declaration types
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user