summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-01-10 09:24:13 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-01-10 09:24:13 +0000
commitf181e51ca1035cbdc57f00479074f724c4a29c6f (patch)
tree00304026c59707ebc778e8d025daa950d7e6b54c
parent38807d772dbc9d1f41a99d10fab26a83c0547d41 (diff)
downloadurpmi-f181e51ca1035cbdc57f00479074f724c4a29c6f.tar
urpmi-f181e51ca1035cbdc57f00479074f724c4a29c6f.tar.gz
urpmi-f181e51ca1035cbdc57f00479074f724c4a29c6f.tar.bz2
urpmi-f181e51ca1035cbdc57f00479074f724c4a29c6f.tar.xz
urpmi-f181e51ca1035cbdc57f00479074f724c4a29c6f.zip
Display usage if no rpm name, nor auto-select was given
-rwxr-xr-xurpmi6
1 files 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$/) {