Run correct command plugin for subcommands

This commit is contained in:
sophia 2021-04-21 14:19:01 -05:00 committed by Paul Hinze
parent 475c5b41d8
commit 201b36ab15
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -375,6 +375,11 @@ func (b *Basis) Components(ctx context.Context) ([]*Component, error) {
}
func (b *Basis) component(ctx context.Context, typ component.Type, name string) (*Component, error) {
// If this is a command type component, the plugin is registered
// as only the root command
if typ == component.CommandType {
name = strings.Split(name, " ")[0]
}
return componentCreatorMap[typ].Create(ctx, b, name)
}