diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-06 06:41:59 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-25 04:25:15 +0300 |
commit | c9360f1626cfe1d6af8d06e5e8fd6cec14c5a839 (patch) | |
tree | a9c7b4f2f457e0a44d3aa6233a0c3ded0ebb53ea /tools | |
parent | 7207e2b984c1bdd58658a9be384fc627770e86c2 (diff) | |
download | u-boot-c9360f1626cfe1d6af8d06e5e8fd6cec14c5a839.tar.xz |
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 <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/patman/main.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/patman/main.py b/tools/patman/main.py index 77f187e769..b96000807e 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 |