diff --git a/doxy-coverage.py b/doxy-coverage.py index 96b2cd3..a2e2715 100755 --- a/doxy-coverage.py +++ b/doxy-coverage.py @@ -149,7 +149,16 @@ def file_cmp (a,b): total_yes += doc_yes total_no += doc_no - print ('%3d%% - %s - (%d of %d)'%(doc_per, f, doc_yes, (doc_yes + doc_no))) + if ns.relative: + if os.path.exists(ns.relative): + relative_path = ns.relative + else: + relative_path = os.path.curdir + file_path = os.path.join(os.path.relpath(os.path.dirname(f), os.path.realpath(relative_path)), os.path.basename(f)) + else: + file_path = f + + print ('%3d%% - %s - (%d of %d)'%(doc_per, file_path, doc_yes, (doc_yes + doc_no))) defs_sorted = defs.keys() defs_sorted.sort() @@ -170,6 +179,8 @@ def main(): parser.add_argument ("dir", action="store", help="Path to Doxygen's XML doc directory") parser.add_argument ("--noerror", action="store_true", help="Do not return error code after execution") parser.add_argument ("--threshold", action="store", help="Min acceptable coverage percentage (Default: %s)"%(ACCEPTABLE_COVERAGE), default=ACCEPTABLE_COVERAGE, type=int) + parser.add_argument ("--relative", nargs="?", action="store", help="Use relative path for output (Default: %s)"%(os.path.curdir), const=os.path.curdir) + global ns ns = parser.parse_args()