summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
131f316)
should be faster
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
return $cmd if exists $def->{$cmd}; # command is already complete
return $cmd if exists $def->{$cmd}; # command is already complete
- my $is_alias = sub { ref($_[0]) eq 'HASH' && $_[0]->{alias} };
+ my $is_alias = sub { ref($_[0]) eq 'HASH' && exists($_[0]->{alias}) };
my @expanded = grep { /^\Q$cmd\E/ && !$is_alias->($def->{$_}) } keys %$def;
return $expanded[0] if scalar(@expanded) == 1; # enforce exact match
my @expanded = grep { /^\Q$cmd\E/ && !$is_alias->($def->{$_}) } keys %$def;
return $expanded[0] if scalar(@expanded) == 1; # enforce exact match