mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
jw.pkg.lib.util.run_cmd(): Add title parameter
Allow the caller to choose which title should be used for the command's logging output box. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
7eb15f2477
commit
75faf02232
1 changed files with 3 additions and 2 deletions
|
|
@ -31,7 +31,8 @@ async def run_cmd(
|
||||||
throw: bool = True,
|
throw: bool = True,
|
||||||
verbose: bool = False,
|
verbose: bool = False,
|
||||||
cmd_input: str|None = None,
|
cmd_input: str|None = None,
|
||||||
env: dict[str, str] | None = None
|
env: dict[str, str] | None = None,
|
||||||
|
title: str=None
|
||||||
) -> tuple[str|None, str|None]:
|
) -> tuple[str|None, str|None]:
|
||||||
"""
|
"""
|
||||||
Run a command asynchronously and return its output
|
Run a command asynchronously and return its output
|
||||||
|
|
@ -75,7 +76,7 @@ async def run_cmd(
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
delim_len = 120
|
delim_len = 120
|
||||||
delim = f'---- running {pretty_cmd(args, wd)} -'
|
delim = title if title is not None else f'---- Running {pretty_cmd(args, wd)} -'
|
||||||
delim += '-' * max(0, delim_len - len(delim))
|
delim += '-' * max(0, delim_len - len(delim))
|
||||||
log(NOTICE, ',' + delim + ' >')
|
log(NOTICE, ',' + delim + ' >')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue