From b37e4c1aeda1b2031c1e680ef45ad9ab6f97b183 Mon Sep 17 00:00:00 2001 From: jpic Date: Mon, 5 Oct 2020 18:24:32 +0200 Subject: [PATCH] Fix shlax.cli (finally) --- shlax/cli.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/shlax/cli.py b/shlax/cli.py index 13a6926..6e99c7e 100644 --- a/shlax/cli.py +++ b/shlax/cli.py @@ -52,18 +52,17 @@ class Command(cli2.Command): if 'actions' in self: del self['actions'] - def call(self, *args, **kwargs): - self.shlax_target = self['target'].value - return self.shlax_target(*args) - def __call__(self, *argv): + result = None + try: - super().__call__(*argv) + result = 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['target'].value.output.results(self['target'].value) + return result class ActionCommand(cli2.Command):