Add debug option back
This commit is contained in:
parent
c84353c126
commit
5c38dc13b0
@ -14,6 +14,16 @@ class Action:
|
||||
r'([^ =]+)=': '{blue}\\1{red}={reset} ',
|
||||
r'=': '{blue}={reset} ',
|
||||
}
|
||||
options = dict(
|
||||
debug=dict(
|
||||
alias='d',
|
||||
default='visit',
|
||||
help='''
|
||||
Display debug output. Supports values (combinable): cmd,out,visit
|
||||
'''.strip(),
|
||||
immediate=True,
|
||||
),
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.args = args
|
||||
|
||||
@ -121,6 +121,10 @@ class ConsoleScript(cli2.ConsoleScript):
|
||||
self[name] = cli2.Callable(
|
||||
name,
|
||||
action.callable(),
|
||||
options={
|
||||
k: cli2.Option(name=k, **v)
|
||||
for k, v in action.options.items()
|
||||
},
|
||||
color=getattr(action, 'color', cli2.YELLOW),
|
||||
)
|
||||
return super().__call__(*args, **kwargs)
|
||||
|
||||
@ -53,6 +53,7 @@ class Output:
|
||||
).encode('utf8'))
|
||||
|
||||
if flush:
|
||||
if not line.endswith('\n'):
|
||||
self.write(b'\n')
|
||||
self.flush()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user