]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move nothing to do warning to main
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Mar 2015 13:57:14 +0000 (06:57 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 10 Mar 2015 13:57:14 +0000 (06:57 -0700)
PR binutils/18101
* readelf.c (parse_args): Move nothing to do warning to ...
(main): Here.

binutils/ChangeLog
binutils/readelf.c

index 062cec4eed45ea4a7f6a447c3b78909a78a1eff2..f59c0d135905d2fc4d88467495cc0cf9acebf908 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/18101
+       * readelf.c (parse_args): Move nothing to do warning to ...
+       (main): Here.
+
 2015-03-10  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/18101
index 771d29dbce600b8a1a312732aed138f8bc8224b2..20cfc473d94749111ea90422b3f48ab90eafb8eb 100644 (file)
@@ -4232,11 +4232,6 @@ parse_args (int argc, char ** argv)
       && !do_section_groups && !do_archive_index
       && !do_dyn_syms)
     usage (stderr);
-  else if (argc < 3 || (do_wide && argc < 4))
-    {
-      warn (_("Nothing to do.\n"));
-      usage (stderr);
-    }
 }
 
 static const char *
@@ -16131,6 +16126,11 @@ main (int argc, char ** argv)
 
   if (optind < (argc - 1))
     show_name = 1;
+  else if (optind >= argc)
+    {
+      warn (_("Nothing to do.\n"));
+      usage (stderr);
+    }
 
   err = 0;
   while (optind < argc)