]> thyrsus.com Git - coverity-submit.git/commitdiff
Quiet the tool down and implement -v.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 12 Jan 2013 23:46:17 +0000 (18:46 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 12 Jan 2013 23:46:17 +0000 (18:46 -0500)
coverity-submit
coverity-submit.xml

index 81fef9c9471c48c1b18e27f0bb78afff6df6b872..bdb3e9f20420aa9fcd20f9733523c0858154c056 100755 (executable)
@@ -33,10 +33,13 @@ if __name__ == '__main__':
 
     # Deduce what project and directory to operate on (and go there).
     noexec = False
-    (opts, args) = getopt.getopt(sys.argv[1:], "n")
+    verbose = False
+    (opts, args) = getopt.getopt(sys.argv[1:], "nv")
     for (opt, arg) in opts:
         if opt == '-n':
             noexec = True
+        if opt == '-v':
+            verbose = True
     where = os.path.basename(os.getcwd())
     if args:
         project = args[0]
@@ -70,7 +73,8 @@ if __name__ == '__main__':
         postbuild = None
 
     def do_or_die(cmd):
-        print(cmd)
+        if verbose:
+            print(cmd)
         if not noexec:
             if os.system(cmd) != 0:
                 sys.stderr.write("Command failed.\n")
@@ -92,20 +96,21 @@ if __name__ == '__main__':
         do_or_die(postbuild)
 
     # Create the tarball
-    print("Bundling up required metadata...")
+    if verbose:
+        print("Bundling up required metadata...")
     readme = """\
     Name: %(name)s
     Email: %(email)s
     Project: %(project)s
     Submitted-by: coverity-submit
     """ % globals()
-    sys.stdout.write(readme)
+    if verbose:
+        sys.stdout.write(readme)
     if not noexec:
         with open("/tmp/README", "w") as wfp:
             wfp.write(readme)
     tarball = "%s-scan.tgz" % project
     do_or_die("mv cov-int /tmp; (cd /tmp; tar -czf %s README cov-int; rm -fr cov-int)" % tarball)
-
     print("Posting the analysis request...")
     do_or_die('''curl \
     --form file=@/tmp/%(tarball)s \
index 796f63b56c86cbe8f6076f7595225cab9c2e754a..339f8b50fa81ee629623e05c8bd1bb886e8bae05 100644 (file)
@@ -20,6 +20,7 @@
 <cmdsynopsis>
   <command>coverity-submit</command>
       <arg choice='opt'>-n </arg>
+      <arg choice='opt'>-v </arg>
       <arg choice='opt'><replaceable>project-name</replaceable></arg>
 </cmdsynopsis>
 </refsynopsisdiv>
@@ -89,8 +90,9 @@ it is selected. Otherwise, a command-line argument can specify the project
 name (it is a fatal error for it not to match one of the configured 
 project profiles).</para>
 
-<para>There is just one option; <option>-n</option>, which says to display
-all the commands that would be run without actually executing them.</para>
+<para>The <option>-n</option> option says to display all the commands that
+would be run without actually executing them. The <option>-v</option> option 
+enables slightly more verbose progress messages.</para>
 
 <para>Once <application>coverity-submit</application> has determined
 which project profile to use, it then performs the following steps:</para>