Prevent print traceback for failed commands
This commit is contained in:
parent
5c76ef3f2d
commit
54e3266789
@ -13,6 +13,8 @@ import importlib
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from .proc import ProcFailure
|
||||||
|
|
||||||
|
|
||||||
class Group(cli2.Group):
|
class Group(cli2.Group):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -55,7 +57,12 @@ class Command(cli2.Command):
|
|||||||
return self.shlax_target(*args)
|
return self.shlax_target(*args)
|
||||||
|
|
||||||
def __call__(self, *argv):
|
def __call__(self, *argv):
|
||||||
super().__call__(*argv)
|
try:
|
||||||
|
super().__call__(*argv)
|
||||||
|
except ProcFailure:
|
||||||
|
# just output the failure without TB, as command was already
|
||||||
|
# printed anyway
|
||||||
|
pass
|
||||||
self.shlax_target.output.results(self.shlax_target)
|
self.shlax_target.output.results(self.shlax_target)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user