X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FCLIHandler.pm;h=149353797238ef481e135fafb9e65b51259a21bf;hp=61434cc87206ce21f7569b2f40a890ccb3904636;hb=e4a1d8e240c18f363f9f91003d01ee07be24ee21;hpb=aa9b9af5a81acdac12403506085e0c2bf769497b diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index 61434cc..1493537 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -337,7 +337,7 @@ sub generate_bash_completions { # this modifies global var, but I found no better way COMP_WORDBREAKS=\${COMP_WORDBREAKS//:} -complete -C '$exename bashcomplete' $exename +complete -o default -C '$exename bashcomplete' $exename __EOD__ } @@ -469,7 +469,7 @@ sub run_cli { die "password callback is no longer supported" if $pwcallback; - run_cli_handler($class, podfn => $podfn, preparefunc => $preparefunc); + run_cli_handler($class, podfn => $podfn, prepare => $preparefunc); } sub run_cli_handler { @@ -481,12 +481,14 @@ sub run_cli_handler { foreach my $key (keys %params) { next if $key eq 'podfn'; - next if $key eq 'preparefunc'; + next if $key eq 'prepare'; + next if $key eq 'no_init'; # used by lxc hooks die "unknown parameter '$key'"; } my $podfn = $params{podfn}; - my $preparefunc = $params{preparefunc}; + my $preparefunc = $params{prepare}; + my $no_init = $params{no_init}; my $pwcallback = $class->can('read_password'); @@ -497,10 +499,10 @@ sub run_cli_handler { if ($class !~ m/^PVE::Service::/) { die "please run as root\n" if $> != 0; - PVE::INotify::inotify_init(); + PVE::INotify::inotify_init() if !$no_init; my $rpcenv = PVE::RPCEnvironment->init('cli'); - $rpcenv->init_request(); + $rpcenv->init_request() if !$no_init; $rpcenv->set_language($ENV{LANG}); $rpcenv->set_user('root@pam'); }