From ea5a508493e9acac4c5a1949dd71fa081892428e Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 14 Jun 2018 09:02:46 +0200 Subject: [PATCH] cli: use exists() for alias check should be faster Signed-off-by: Wolfgang Bumiller --- src/PVE/CLIHandler.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index 489ff97..a7ced38 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -54,7 +54,7 @@ my $expand_command_name = sub { 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 -- 2.39.2