[llvm] r294616 - [utils] coverage: Add help text about the --restrict flag (NFC)

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 11:37:18 PST 2017


Author: vedantk
Date: Thu Feb  9 13:37:18 2017
New Revision: 294616

URL: http://llvm.org/viewvc/llvm-project?rev=294616&view=rev
Log:
[utils] coverage: Add help text about the --restrict flag (NFC)

Passing the --restrict flag to the coverage prep script before other
positional arguments is wrong, because it prevents the argparse module
from telling apart arguments to --restrict versus positional arguments.

Pointed out by Sean Callanan!

Modified:
    llvm/trunk/utils/prepare-code-coverage-artifact.py

Modified: llvm/trunk/utils/prepare-code-coverage-artifact.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/prepare-code-coverage-artifact.py?rev=294616&r1=294615&r2=294616&view=diff
==============================================================================
--- llvm/trunk/utils/prepare-code-coverage-artifact.py (original)
+++ llvm/trunk/utils/prepare-code-coverage-artifact.py Thu Feb  9 13:37:18 2017
@@ -6,6 +6,9 @@ from __future__ import print_function
 
 - Collate raw profiles into one indexed profile.
 - Generate html reports for the given binaries.
+
+Caution: The positional arguments to this script must be specified before any 
+optional arguments, such as --restrict.
 '''
 
 import argparse
@@ -84,7 +87,8 @@ if __name__ == '__main__':
                        help='Emit a unified report for all binaries')
     parser.add_argument('--restrict', metavar='R', type=str, nargs='*',
                        default=[],
-                       help='Restrict the reporting to the given source paths')
+                       help='Restrict the reporting to the given source paths'
+                   ' (must be specified after all other positional arguments)')
     args = parser.parse_args()
 
     if args.use_existing_profdata and args.only_merge:




More information about the llvm-commits mailing list