Fix shlax.cli (finally)
This commit is contained in:
parent
4ea9783c93
commit
b37e4c1aed
11
shlax/cli.py
11
shlax/cli.py
@ -52,18 +52,17 @@ class Command(cli2.Command):
|
|||||||
if 'actions' in self:
|
if 'actions' in self:
|
||||||
del self['actions']
|
del self['actions']
|
||||||
|
|
||||||
def call(self, *args, **kwargs):
|
|
||||||
self.shlax_target = self['target'].value
|
|
||||||
return self.shlax_target(*args)
|
|
||||||
|
|
||||||
def __call__(self, *argv):
|
def __call__(self, *argv):
|
||||||
|
result = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
super().__call__(*argv)
|
result = super().__call__(*argv)
|
||||||
except ProcFailure:
|
except ProcFailure:
|
||||||
# just output the failure without TB, as command was already
|
# just output the failure without TB, as command was already
|
||||||
# printed anyway
|
# printed anyway
|
||||||
pass
|
pass
|
||||||
self.shlax_target.output.results(self.shlax_target)
|
self['target'].value.output.results(self['target'].value)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
class ActionCommand(cli2.Command):
|
class ActionCommand(cli2.Command):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user