================ @@ -30,26 +30,28 @@ def findFilesWithExtension(path, extension): def clean(args): - if len(args) != 2: + if len(args) < 2: print( - "Usage: %s clean <path> <extension>\n" % __file__ + "Usage: %s clean <paths> <extension>\n" % __file__ + "\tRemoves all files with extension from <path>." ) return 1 - for filename in findFilesWithExtension(args[0], args[1]): - os.remove(filename) + for path in args[1:-1]: + for filename in findFilesWithExtension(path, args[-1]): + os.remove(filename) return 0 def merge(args): - if len(args) != 3: + if len(args) < 3: print( - "Usage: %s merge <llvm-profdata> <output> <path>\n" % __file__ + "Usage: %s merge <llvm-profdata> <output> <paths>\n" % __file__ + "\tMerges all profraw files from path into output." ) return 1 cmd = [args[0], "merge", "-o", args[1]] - cmd.extend(findFilesWithExtension(args[2], "profraw")) + for i in range(2, len(args)): + cmd.extend(findFilesWithExtension(args[i], "profraw")) ---------------- petrhosek wrote:
```suggestion for path in args[2:]: cmd.extend(findFilesWithExtension(path, "profraw")) ``` https://github.com/llvm/llvm-project/pull/78879 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits