MISRA addon: Support multiple files with argparse (#1327)

This commit is contained in:
Kyle Chisholm 2018-08-04 15:37:08 -04:00 committed by Daniel Marjamäki
parent b68759ccf5
commit aa831ce972
1 changed files with 5 additions and 4 deletions

View File

@ -1679,7 +1679,7 @@ def generateTable():
# what rules are handled by this addon? # what rules are handled by this addon?
addon = [] addon = []
compiled = re.compile(r'[ ]+misra_([0-9]+)_([0-9]+)[(].*') compiled = re.compile(r'[ ]+misra_([0-9]+)_([0-9]+)[(].*')
for line in open('__file__'): for line in open(__file__):
res = compiled.match(line) res = compiled.match(line)
if res is None: if res is None:
continue continue
@ -1879,7 +1879,7 @@ parser.add_argument("--quiet", help="Only print something when there is an error
parser.add_argument("--no-summary", help="Hide summary of violations", action="store_true") parser.add_argument("--no-summary", help="Hide summary of violations", action="store_true")
parser.add_argument("-verify", help=argparse.SUPPRESS, action="store_true") parser.add_argument("-verify", help=argparse.SUPPRESS, action="store_true")
parser.add_argument("-generate-table", help=argparse.SUPPRESS, action="store_true") parser.add_argument("-generate-table", help=argparse.SUPPRESS, action="store_true")
parser.add_argument("file", help="Path of dump file from cppcheck") parser.add_argument("dumpfile", nargs='*', help="Path of dump file from cppcheck")
args = parser.parse_args() args = parser.parse_args()
if args.generate_table: if args.generate_table:
@ -1899,5 +1899,6 @@ else:
QUIET = True QUIET = True
if args.no_summary: if args.no_summary:
SHOW_SUMMARY = False SHOW_SUMMARY = False
if args.file: if args.dumpfile:
parseDump(args.file) for item in args.dumpfile:
parseDump(item)