diff options
author | Devaev Maxim <[email protected]> | 2021-02-16 09:07:51 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-02-16 09:07:51 +0300 |
commit | 3e289262f8a08042cd81eb7ebd8b75404020d945 (patch) | |
tree | bc46b8eea354d2e1e9544ac7f3595200e1c7d220 /kvmd/tools.py | |
parent | 70fb46d4287e33d34dbf72156372a5c55cb273f7 (diff) |
additional cmd options
Diffstat (limited to 'kvmd/tools.py')
-rw-r--r-- | kvmd/tools.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kvmd/tools.py b/kvmd/tools.py index 8857796d..d6077938 100644 --- a/kvmd/tools.py +++ b/kvmd/tools.py @@ -73,3 +73,13 @@ def clear_queue(q: multiprocessing.queues.Queue) -> None: # pylint: disable=inv q.get_nowait() except queue.Empty: break + + +# ===== +def build_cmd(cmd: List[str], cmd_remove: List[str], cmd_append: List[str]) -> List[str]: + assert len(cmd) >= 1, cmd + return [ + cmd[0], # Executable + *filter((lambda item: item not in cmd_remove), cmd[1:]), + *cmd_append, + ] |