From: Simon Glass Date: Mon, 6 Jul 2020 03:41:59 +0000 (-0600) Subject: patman: Add a -D option to enable debugging X-Git-Tag: v2020.10~104^2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fc2e632f59050332dbc8e06b561cbe0a0534473;p=platform%2Fkernel%2Fu-boot.git patman: Add a -D option to enable debugging Most users don't want to see traceback errors. Add an option to enable them for debugging. Disable them by default. Signed-off-by: Simon Glass --- diff --git a/tools/patman/main.py b/tools/patman/main.py index 77f187e..b960008 100755 --- a/tools/patman/main.py +++ b/tools/patman/main.py @@ -10,6 +10,7 @@ from argparse import ArgumentParser import os import re import sys +import traceback import unittest if __name__ == "__main__": @@ -34,6 +35,8 @@ def AddCommonArgs(parser): default=-1, help='Automatically create patches from top n commits') parser.add_argument('-e', '--end', type=int, default=0, help='Commits to skip at end of patch list') + parser.add_argument('-D', '--debug', action='store_true', + help='Enabling debugging (provides a full traceback on error)') parser.add_argument('-s', '--start', dest='start', type=int, default=0, help='Commit to start creating patches from (0 = HEAD)') @@ -98,6 +101,9 @@ if hasattr(args, 'project'): if __name__ != "__main__": pass +if not args.debug: + sys.tracebacklimit = 0 + # Run our meagre tests if args.cmd == 'test': import doctest