From 0d134a2830752c2e1cc416c2f26da8bd0864e432 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 6 Mar 2025 17:50:18 -0600 Subject: [PATCH] scripts: Re-added -q/--quiet to result scripts I forgot that this is still useful for erroring scripts, such as stack.py when checking for recursion. Technically this is possible with -o/dev/null, but that's both unnecessarily complicated and includes the csv encoding cost for no reason. --- scripts/code.py | 6 +++++- scripts/cov.py | 6 +++++- scripts/csv.py | 6 +++++- scripts/ctx.py | 6 +++++- scripts/data.py | 6 +++++- scripts/perf.py | 6 +++++- scripts/perfbd.py | 6 +++++- scripts/stack.py | 6 +++++- scripts/structs.py | 6 +++++- 9 files changed, 45 insertions(+), 9 deletions(-) diff --git a/scripts/code.py b/scripts/code.py index 0f17cae6..3d430c50 100755 --- a/scripts/code.py +++ b/scripts/code.py @@ -1083,7 +1083,7 @@ def main(obj_paths, *, fields=fields, **args) # print table - else: + elif not args.get('quiet'): table(CodeResult, results, diff_results, by=by, fields=fields, @@ -1105,6 +1105,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/cov.py b/scripts/cov.py index 96e99a99..75b44d04 100755 --- a/scripts/cov.py +++ b/scripts/cov.py @@ -1041,7 +1041,7 @@ def main(gcda_paths, *, fields=fields, **args) # print table - else: + elif not args.get('quiet'): table(CovResult, results, diff_results, by=by, fields=fields, @@ -1071,6 +1071,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/csv.py b/scripts/csv.py index 5487c8bf..58e1b5d6 100755 --- a/scripts/csv.py +++ b/scripts/csv.py @@ -2374,7 +2374,7 @@ def main(csv_paths, *, depth=depth, **args) # print table - else: + elif not args.get('quiet'): table(Result, results, diff_results, by=by, fields=fields, @@ -2402,6 +2402,10 @@ if __name__ == "__main__": '--help-exprs', action='store_true', help="Show what field exprs are available.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/ctx.py b/scripts/ctx.py index 29c606c2..1dbbea2f 100755 --- a/scripts/ctx.py +++ b/scripts/ctx.py @@ -1379,7 +1379,7 @@ def main(obj_paths, *, depth=depth, **args) # print table - else: + elif not args.get('quiet'): table(CtxResult, results, diff_results, by=by, fields=fields, @@ -1403,6 +1403,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/data.py b/scripts/data.py index 9c558eec..bd91f0e3 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -1083,7 +1083,7 @@ def main(obj_paths, *, fields=fields, **args) # print table - else: + elif not args.get('quiet'): table(DataResult, results, diff_results, by=by, fields=fields, @@ -1105,6 +1105,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/perf.py b/scripts/perf.py index 8c344537..cbc8f54f 100755 --- a/scripts/perf.py +++ b/scripts/perf.py @@ -1604,7 +1604,7 @@ def report(perf_paths, *, fields=fields, depth=depth, **args) - else: + elif not args.get('quiet'): # print table table(PerfResult, results, diff_results, by=by, @@ -1648,6 +1648,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/perfbd.py b/scripts/perfbd.py index a7d0410f..4311876c 100755 --- a/scripts/perfbd.py +++ b/scripts/perfbd.py @@ -1601,7 +1601,7 @@ def report(paths, *, depth=depth, **args) # print table - else: + elif not args.get('quiet'): table(PerfBdResult, results, diff_results, by=by, fields=fields, @@ -1649,6 +1649,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/stack.py b/scripts/stack.py index 77209a27..ac7c3d64 100755 --- a/scripts/stack.py +++ b/scripts/stack.py @@ -1118,7 +1118,7 @@ def main(ci_paths, depth=depth, **args) # print table - else: + elif not args.get('quiet'): table(StackResult, results, diff_results, by=by, fields=fields, @@ -1147,6 +1147,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.") diff --git a/scripts/structs.py b/scripts/structs.py index 6f901350..3eb6462c 100755 --- a/scripts/structs.py +++ b/scripts/structs.py @@ -1260,7 +1260,7 @@ def main(obj_paths, *, depth=depth, **args) # print table - else: + elif not args.get('quiet'): table(StructResult, results, diff_results, by=by, fields=fields, @@ -1284,6 +1284,10 @@ if __name__ == "__main__": '-v', '--verbose', action='store_true', help="Output commands that run behind the scenes.") + parser.add_argument( + '-q', '--quiet', + action='store_true', + help="Don't show anything, useful when checking for errors.") parser.add_argument( '-o', '--output', help="Specify CSV file to store results.")