From 224608878ecdca60ead9caf81f145f62514892ef Mon Sep 17 00:00:00 2001 From: jpic Date: Thu, 11 Jun 2020 03:19:13 +0200 Subject: [PATCH] Clean on KeyboardInterrupt, proper call in shlax Command --- shlax/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shlax/cli.py b/shlax/cli.py index 4fac0fb..770e920 100644 --- a/shlax/cli.py +++ b/shlax/cli.py @@ -45,9 +45,13 @@ 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(self.target) + def __call__(self, *argv): super().__call__(*argv) - self['target'].value.output.results(self['target'].value) + self.shlax_target.output.results(self.shlax_target) class ActionCommand(cli2.Command):