1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

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>
This commit is contained in:
Simon Glass
2020-07-05 21:41:59 -06:00
parent df3fc0757b
commit 0fc2e632f5

View File

@@ -10,6 +10,7 @@ from argparse import ArgumentParser
import os import os
import re import re
import sys import sys
import traceback
import unittest import unittest
if __name__ == "__main__": if __name__ == "__main__":
@@ -34,6 +35,8 @@ def AddCommonArgs(parser):
default=-1, help='Automatically create patches from top n commits') default=-1, help='Automatically create patches from top n commits')
parser.add_argument('-e', '--end', type=int, default=0, parser.add_argument('-e', '--end', type=int, default=0,
help='Commits to skip at end of patch list') 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, parser.add_argument('-s', '--start', dest='start', type=int,
default=0, help='Commit to start creating patches from (0 = HEAD)') default=0, help='Commit to start creating patches from (0 = HEAD)')
@@ -98,6 +101,9 @@ if hasattr(args, 'project'):
if __name__ != "__main__": if __name__ != "__main__":
pass pass
if not args.debug:
sys.tracebacklimit = 0
# Run our meagre tests # Run our meagre tests
if args.cmd == 'test': if args.cmd == 'test':
import doctest import doctest