mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 19:39:56 +00:00
pvenode: allow replying on samle line on interactive questions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
7ffd15504e
commit
c8d8937c38
@ -95,11 +95,11 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
my $term = Term::ReadLine->new('pvenode');
|
my $term = Term::ReadLine->new('pvenode');
|
||||||
my $get_dir_selection = sub {
|
my $get_dir_selection = sub {
|
||||||
my $selection = $term->readline("Enter selection:\n");
|
my $selection = $term->readline("Enter selection: ");
|
||||||
if ($selection =~ /^(\d+)$/) {
|
if ($selection =~ /^(\d+)$/) {
|
||||||
$selection = $1;
|
$selection = $1;
|
||||||
if ($selection == $i) {
|
if ($selection == $i) {
|
||||||
$param->{directory} = $term->readline("Enter URL:\n");
|
$param->{directory} = $term->readline("Enter custom URL: ");
|
||||||
return;
|
return;
|
||||||
} elsif ($selection < $i && $selection >= 0) {
|
} elsif ($selection < $i && $selection >= 0) {
|
||||||
$param->{directory} = $directories->[$selection]->{url};
|
$param->{directory} = $directories->[$selection]->{url};
|
||||||
@ -121,7 +121,7 @@ __PACKAGE__->register_method({
|
|||||||
if ($tos) {
|
if ($tos) {
|
||||||
print "Terms of Service: $tos\n";
|
print "Terms of Service: $tos\n";
|
||||||
my $term = Term::ReadLine->new('pvenode');
|
my $term = Term::ReadLine->new('pvenode');
|
||||||
my $agreed = $term->readline('Do you agree to the above terms? [y|N]');
|
my $agreed = $term->readline('Do you agree to the above terms? [y|N]: ');
|
||||||
die "Cannot continue without agreeing to ToS, aborting.\n"
|
die "Cannot continue without agreeing to ToS, aborting.\n"
|
||||||
if ($agreed !~ /^y$/i);
|
if ($agreed !~ /^y$/i);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user