]> sourceware.org Git - systemtap.git/commitdiff
Don't double print error message on bad stap command line option.
authorMark Wielaard <mjw@redhat.com>
Fri, 11 Jun 2010 12:20:08 +0000 (14:20 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 11 Jun 2010 12:20:08 +0000 (14:20 +0200)
Bug introduced in commit db1354. getopt_long will already have printed
an appropriate error message in case of an invalid/unrecognized option
or an option missing an required argument. So don't print another error
message in that case.

* session.cxx (parse_cmdline): Silently handle '?' case.

session.cxx

index 861398824f2743f58d6665d370cb614c2b09bd26..544e50a805b67dbef2360942fafb0282ed45e470 100644 (file)
@@ -742,6 +742,13 @@ systemtap_session::parse_cmdline (int argc, char * const argv [])
             }
           break;
 
+       case '?':
+         // Invalid/unrecognized option given or argument required, but
+         // not given. In both cases getopt_long() will have printed the
+         // appropriate error message to stderr already.
+         return 1;
+         break;
+
         default:
           // NOTREACHED unless one added a getopt option but not a corresponding switch/case:
           cerr << "Unhandled argument code " << (char)grc << endl;
This page took 0.032007 seconds and 5 git commands to generate.