Fix abidw -v
authorDodji Seketeli <dodji@redhat.com>
Tue, 5 Jan 2016 11:32:24 +0000 (12:32 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 5 Jan 2016 11:35:57 +0000 (12:35 +0100)
abidw -v was failing to work until now.  This patch fixes that.

* tools/abidw.cc (parse_command_line): Simplify logic.
(main): Fix logic.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
tools/abidw.cc

index 5d8ed9859fb0d76676d1a0adacd14843c4352dc7..a0455dbdc1509124047a273f4bd608bf713aa81d 100644 (file)
@@ -127,10 +127,7 @@ parse_command_line(int argc, char* argv[], options& opts)
        }
       else if (!strcmp(argv[i], "--version")
               || !strcmp(argv[i], "-v"))
-       {
-         opts.display_version = true;
-         return true;
-       }
+       opts.display_version = true;
       else if (!strcmp(argv[i], "--debug-info-dir")
               || !strcmp(argv[i], "-d"))
        {
@@ -211,7 +208,8 @@ main(int argc, char* argv[])
   options opts;
 
   if (!parse_command_line(argc, argv, opts)
-      || opts.in_file_path.empty())
+      || (opts.in_file_path.empty()
+         && !opts.display_version))
     {
       display_usage(argv[0], cerr);
       return 1;