summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-03-23 13:45:36 +0200
committerLars Wirzenius <liw@liw.fi>2019-03-23 13:45:36 +0200
commite74ec68e3e14873dd348c55e5a318e185cbf72a1 (patch)
treec2f1acef49bfdf830bdb731a533089256c55ed40
parent61f1fc798cd3447d1b926d33e7da450eb6273766 (diff)
downloadeffitool-e74ec68e3e14873dd348c55e5a318e185cbf72a1.tar.gz
Change: add --debug option to show Python traceback on error
-rwxr-xr-xeffitool4
1 files changed, 4 insertions, 0 deletions
diff --git a/effitool b/effitool
index 611c932..35febb6 100755
--- a/effitool
+++ b/effitool
@@ -23,6 +23,7 @@ import http
import json
import os
import sys
+import traceback
import urllib.request
@@ -448,6 +449,7 @@ def process_args(config):
factory = p.add_subparsers()
p.add_argument('-a', '--api')
+ p.add_argument('--debug', action='store_true')
for name, func, args in subcommands:
pp = factory.add_parser(name)
@@ -460,6 +462,8 @@ def process_args(config):
try:
func(args)
except Exception as e:
+ if args['debug']:
+ sys.stderr.write('{}\n'.format(traceback.format_exc()))
sys.exit(str(e))