From f181e51ca1035cbdc57f00479074f724c4a29c6f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 10 Jan 2006 09:24:13 +0000 Subject: Display usage if no rpm name, nor auto-select was given --- urpmi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/urpmi b/urpmi index fd513c60..bfb9eae5 100755 --- a/urpmi +++ b/urpmi @@ -71,7 +71,7 @@ delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; $ENV{HOME} ||= "/root"; $ENV{USER} ||= "root"; -sub usage { +sub usage () { print N("urpmi version %s Copyright (C) 1999-2005 Mandriva. This is free software and may be redistributed under the terms of the GNU GPL. @@ -149,7 +149,6 @@ usage: # Parse command line my $command_line = join " ", @ARGV; -@ARGV or usage; my @ARGVcopy; # keep a copy, in case we have to restart # Expand *.urpmi arguments @@ -171,6 +170,9 @@ if (grep { $_ eq '--restricted' } @ARGV) { # Parse command line options urpm::args::parse_cmdline(urpm => $urpm); +# Verify that arguments were given +@ARGV || $auto_select or usage; + # Process the rest of the arguments while (defined($_ = shift @ARGV)) { if (/\.rpm$/) { -- cgit v1.2.1