+ exit(0) if !(defined($ENV{COMP_LINE}) && defined($ENV{COMP_POINT}));
+
+ my $cmdlist = join('|', keys %$cli_class_handlers);
+ if ($ENV{COMP_LINE} =~ m/^(.*pveclient\s+($cmdlist)\s+)(.*)$/) {
+ my $cmd = $2;
+ my $class = $cli_class_handlers->{$cmd} || die "internal error";
+ $ENV{COMP_LINE} = "pveclient $3";
+ $ENV{COMP_POINT} = length($ENV{COMP_LINE});
+ @ARGV = ('bashcomplete', 'pveclient', $ARGV[1], $ARGV[2]);
+
+ $class->run_cli_handler();
+
+ } else {