use warnings;
use PVE::APIClient::SafeSyslog;
-use PVE::APIClient::Exception qw(raise raise_param_exc);
use PVE::APIClient::RESTHandler;
$cli_handler_class->can('string_param_file_mapping');
my ($subcmd, $def, undef, undef, $cmdstr) = resolve_cmd($cmd);
- die "no such command '$cmd->[0]'\n" if !defined($def) && ref($cmd) eq 'ARRAY';
+ $abort->("unknown command '$cmdstr'") if !defined($def) && ref($cmd) eq 'ARRAY';
my $generate;
$generate = sub {
shift @$args; # no need for program name
my $print_result = sub {
foreach my $p (@_) {
- print "$p\n" if $p =~ m/^$cur/;
+ print "$p\n" if $p =~ m/^\Q$cur\E/;
}
};
return $password;
}
+sub get_confirmed_password {
+ my $pw1 = read_password('Enter new password: ');
+ my $pw2 = read_password('Retype new password: ');
+ die "passwords do not match\n" if $pw1 ne $pw2;
+ return $pw1;
+}
+
# Class functions
sub new {
no strict 'refs'; # our autoload requires this
use warnings;
use PVE::APIClient::SafeSyslog;
-use PVE::APIClient::Exception qw(raise raise_param_exc);
+use PVE::APIClient::Exception qw(raise);
use PVE::APIClient::JSONSchema;
use PVE::APIClient::Tools;
use HTTP::Status qw(:constants :is status_message);