This commit is contained in:
jpic 2020-04-18 19:52:22 +02:00
parent ef7656ddea
commit 85e11755f7
2 changed files with 5 additions and 2 deletions

View File

@ -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:

View File

@ -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):