shell: add restart command, fix call None arg, add tests

This commit is contained in:
2026-05-22 22:38:35 +02:00
parent 67ae693d0c
commit 5f92b6f6de
4 changed files with 98 additions and 30 deletions
+7 -1
View File
@@ -16,6 +16,12 @@ def start(no_daemon: bool = False):
subprocess.run(args + ["-n"] + ([] if no_daemon else ["-d"]), check=True)
@app.command()
def restart(no_daemon: bool = False):
subprocess.run(args + ["kill"], check=False)
subprocess.run(args + ["-n"] + ([] if no_daemon else ["-d"]), check=True)
@app.command()
def show():
subprocess.run(args + ["ipc"] + ["show"], check=True)
@@ -33,4 +39,4 @@ def lock():
@app.command()
def call(target: str, method: str, method_args: list[str] = typer.Argument(None)):
subprocess.run(args + ["ipc"] + ["call"] + [target] + [method] + method_args, check=True)
subprocess.run(args + ["ipc"] + ["call"] + [target] + [method] + (method_args or []), check=True)