@@ -277,6 +277,7 @@ func enumerateExecutableAliasRefs(
277277) executable.RefList {
278278 refs := make (executable.RefList , 0 )
279279
280+ // Always include explicit verb aliases defined on the executable itself
280281 for _ , v := range exec .VerbAliases {
281282 if err := v .Validate (); err != nil {
282283 continue
@@ -287,26 +288,30 @@ func enumerateExecutableAliasRefs(
287288 }
288289 }
289290
291+ // Always include name (ID) aliases for the executable's primary verb
292+ for _ , id := range exec .AliasesIDs () {
293+ refs = append (refs , executable .NewRef (id , exec .Verb ))
294+ }
295+
290296 switch {
291297 case override == nil :
292- // use default aliases
298+ // use default aliases (related verbs for the primary verb)
293299 for _ , verb := range executable .RelatedVerbs (exec .Verb ) {
294300 refs = append (refs , executable .NewRef (exec .ID (), verb ))
295301 for _ , id := range exec .AliasesIDs () {
296302 refs = append (refs , executable .NewRef (id , verb ))
297303 }
298304 }
299305 case len (* override ) == 0 :
300- // disable all aliases if override is set but empty
301- return refs
306+ // verb overrides explicitly disable verb aliases; keep only name aliases and explicit verb aliases
307+ // nothing more to add
302308 default :
303309 // use overrides if provided
304310 o := * override
305311 if verbs , found := o [exec .Verb .String ()]; found {
306312 for _ , v := range verbs {
307313 vv := executable .Verb (v )
308314 if err := vv .Validate (); err != nil {
309- // If the verb is not valid, skip it
310315 continue
311316 }
312317 refs = append (refs , executable .NewRef (exec .ID (), vv ))
0 commit comments