From 0c8f651988b155d12deb3aea26c2f206648c61e5 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 14 Apr 2004 13:47:02 +0000 Subject: Factorize the message/prompt/I18N code of urpm* in a separate module --- urpme | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'urpme') diff --git a/urpme b/urpme index 3e1a1070..1d5686d1 100644 --- a/urpme +++ b/urpme @@ -23,8 +23,9 @@ use strict; use urpm; use urpm::args; +use urpm::msg; -our ($root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, $force, $bug, @l); +our ($root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, $force, @l); my $askok = N("Is this OK?"); # Translator: Add here the keys which might be pressed in the "No"-case. my $noexpr = N("Nn"); @@ -112,30 +113,3 @@ sub toMb { my $nb = $_[0] / 1024 / 1024; int $nb + 0.5; } - -sub message_input { - my ($msg, $default_input, %options) = @_; - my $input; - my $noexpr = N("Nn"); - my $yesexpr = N("Yy"); - - while (1) { - print STDOUT $msg; - if ($default_input) { - $bug and log_it($input); - return $default_input; - } - $input = ; - defined $input or return undef; - $bug and log_it($input); - if ($options{boolean}) { - $input =~ /^[$noexpr$yesexpr]*$/ and last; - } elsif ($options{range}) { - 1 <= $input && $input <= $options{range} and last; - } else { - last; - } - print STDOUT N("Sorry, bad choice, try again\n")."\n"; - } - return $input; -} -- cgit v1.2.1