diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-11-24 08:51:23 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-11-24 08:51:23 +0000 |
commit | e4daecb730c13bf6df7b61f9e6ef700935cbc7ae (patch) | |
tree | 0771f7f5e2639b739fb79f6a3b92b396d6ea3a3e /urpm/msg.pm | |
parent | eb121a97faaa6e187da2e1ff9896cb815bfd03ec (diff) | |
download | urpmi-e4daecb730c13bf6df7b61f9e6ef700935cbc7ae.tar urpmi-e4daecb730c13bf6df7b61f9e6ef700935cbc7ae.tar.gz urpmi-e4daecb730c13bf6df7b61f9e6ef700935cbc7ae.tar.bz2 urpmi-e4daecb730c13bf6df7b61f9e6ef700935cbc7ae.tar.xz urpmi-e4daecb730c13bf6df7b61f9e6ef700935cbc7ae.zip |
When asking for choices, default to the first one
Diffstat (limited to 'urpm/msg.pm')
-rw-r--r-- | urpm/msg.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/urpm/msg.pm b/urpm/msg.pm index 308deda3..8c681fa9 100644 --- a/urpm/msg.pm +++ b/urpm/msg.pm @@ -70,10 +70,12 @@ sub message_input { } $input = <STDIN>; defined $input or return undef; + chomp $input; $urpm::args::options{bug} and log_it($input); if ($opts{boolean}) { - $input =~ /^[$noexpr$yesexpr]*$/ and last; + $input =~ /^[$noexpr$yesexpr]?$/ and last; } elsif ($opts{range}) { + $input eq "" and $input = 1; #- defaults to first choice (defined $opts{range_min} ? $opts{range_min} : 1) <= $input && $input <= $opts{range} and last; } else { last; |