we do not complete them in bash copletion either and their just there
for backward compatibillity, so filter them out.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
return $cmd if exists $def->{$cmd}; # command is already complete
return $cmd if exists $def->{$cmd}; # command is already complete
- my @expanded = grep { /^\Q$cmd\E/ } keys %$def;
+ my $is_alias = sub { ref($_[0]) eq 'HASH' && $_[0]->{alias} };
+ my @expanded = grep { /^\Q$cmd\E/ && !$is_alias->($def->{$_}) } keys %$def;
+
return $expanded[0] if scalar(@expanded) == 1; # enforce exact match
return undef;
return $expanded[0] if scalar(@expanded) == 1; # enforce exact match
return undef;