From: Eric S. Raymond Date: Sat, 12 Jan 2013 23:46:17 +0000 (-0500) Subject: Quiet the tool down and implement -v. X-Git-Tag: 1.4~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=46d63e67b58737ca0e3749fbfe2f7990eda53286;p=coverity-submit.git Quiet the tool down and implement -v. --- diff --git a/coverity-submit b/coverity-submit index 81fef9c..bdb3e9f 100755 --- a/coverity-submit +++ b/coverity-submit @@ -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 \ diff --git a/coverity-submit.xml b/coverity-submit.xml index 796f63b..339f8b5 100644 --- a/coverity-submit.xml +++ b/coverity-submit.xml @@ -20,6 +20,7 @@ coverity-submit -n + -v project-name @@ -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). -There is just one option; , which says to display -all the commands that would be run without actually executing them. +The option says to display all the commands that +would be run without actually executing them. The option +enables slightly more verbose progress messages. Once coverity-submit has determined which project profile to use, it then performs the following steps: