From 85e11755f7bb83a29b924014e5714d5ed85c9265 Mon Sep 17 00:00:00 2001 From: jpic Date: Sat, 18 Apr 2020 19:52:22 +0200 Subject: [PATCH] wip --- shlax/actions/base.py | 5 +++-- shlax/cli.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shlax/actions/base.py b/shlax/actions/base.py index fffd955..9f66e96 100644 --- a/shlax/actions/base.py +++ b/shlax/actions/base.py @@ -42,7 +42,8 @@ class Action: '''.strip(), immediate=True, ), - v=dict( + verbose=dict( + alias='v', default=False, help='Verbose, like -d=visit,cmd,out', immediate=True, @@ -117,7 +118,7 @@ class Action: output = Output( regexp=self.regexps, - debug='cmd,visit,out' if options['v'] else options['debug'], + debug='cmd,visit,out' if options['verbose'] else options['debug'], ) results = [] for target in targets: diff --git a/shlax/cli.py b/shlax/cli.py index b153d8a..1596b22 100644 --- a/shlax/cli.py +++ b/shlax/cli.py @@ -160,6 +160,7 @@ class ConsoleScript(cli2.ConsoleScript): # ??? gotta be missing something, commenting meanwhile # action = copy.deepcopy(action) return await action(*self.parser.targets, **options) + cb.__name__ = type(action).__name__ return cb def action_class(self, action_class): @@ -214,6 +215,7 @@ class ConsoleScript(cli2.ConsoleScript): options.update(self.parser.options) return await action_class(*_args, **kwargs)(*self.parser.targets, **options) cb.__doc__ = (inspect.getdoc(action_class) or '').split("\n")[0] + cb.__name__ = action_class.__name__ return cb def call(self, command):