summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-28 07:06:11 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-28 07:06:11 +0000
commit7b02dcbc138f9aa51547445504acfdd32c5f8bf1 (patch)
tree9314f154c29dd25d7c1bd6b8e0a1052d14afef93
parent693e214b84e219c5ad88065d538ad764f50e485d (diff)
downloadurpmi-7b02dcbc138f9aa51547445504acfdd32c5f8bf1.tar
urpmi-7b02dcbc138f9aa51547445504acfdd32c5f8bf1.tar.gz
urpmi-7b02dcbc138f9aa51547445504acfdd32c5f8bf1.tar.bz2
urpmi-7b02dcbc138f9aa51547445504acfdd32c5f8bf1.tar.xz
urpmi-7b02dcbc138f9aa51547445504acfdd32c5f8bf1.zip
Allow to give several comma- or space-separated answers to the question
"One of the following packages is needed, what is your choice?" in urpmi
-rwxr-xr-xurpmi5
1 files changed, 5 insertions, 0 deletions
diff --git a/urpmi b/urpmi
index a09edce3..dc3ab3fe 100755
--- a/urpmi
+++ b/urpmi
@@ -350,6 +350,11 @@ sub ask_choice {
my $i = 0; foreach (@l) { message(" " . ++$i . "- $_") }
$n = message_input(N("What is your choice? (1-%d) ", $i), undef, range_min => 0, range => $i);
defined($n) && $n ne "0" or exit 1; # abort.
+ if ($n =~ /\D/) {
+ my @nn = map { $choices->[$_ - 1] } grep { !/\D/ } split /[, \t]+/, $n;
+ @nn or exit 1;
+ return @nn;
+ }
}
$choices->[$n - 1];
}