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}\\1{red}={reset} ',
|
||||||
r'=': '{blue}={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):
|
def __init__(self, *args, **kwargs):
|
||||||
self.args = args
|
self.args = args
|
||||||
|
|||||||
@ -121,6 +121,10 @@ class ConsoleScript(cli2.ConsoleScript):
|
|||||||
self[name] = cli2.Callable(
|
self[name] = cli2.Callable(
|
||||||
name,
|
name,
|
||||||
action.callable(),
|
action.callable(),
|
||||||
|
options={
|
||||||
|
k: cli2.Option(name=k, **v)
|
||||||
|
for k, v in action.options.items()
|
||||||
|
},
|
||||||
color=getattr(action, 'color', cli2.YELLOW),
|
color=getattr(action, 'color', cli2.YELLOW),
|
||||||
)
|
)
|
||||||
return super().__call__(*args, **kwargs)
|
return super().__call__(*args, **kwargs)
|
||||||
|
|||||||
@ -53,7 +53,8 @@ class Output:
|
|||||||
).encode('utf8'))
|
).encode('utf8'))
|
||||||
|
|
||||||
if flush:
|
if flush:
|
||||||
self.write(b'\n')
|
if not line.endswith('\n'):
|
||||||
|
self.write(b'\n')
|
||||||
self.flush()
|
self.flush()
|
||||||
|
|
||||||
def cmd(self, line):
|
def cmd(self, line):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user