Files
zshell-PKGBUILD/pkg/zshell/usr/lib/python3.14/site-packages/zshell/subcommands/shell.py
T
Zacharias-Brohn a3c1c8f234 branch
2026-02-23 23:06:32 +01:00

38 lines
775 B
Python

import subprocess
import typer
args = ["qs", "-c", "zshell"]
app = typer.Typer()
@app.command()
def kill():
subprocess.run(args + ["kill"], check=True)
@app.command()
def start(no_daemon: bool = False):
subprocess.run(args + ["-n"] + ([] if no_daemon else ["-d"]), check=True)
@app.command()
def show():
subprocess.run(args + ["ipc"] + ["show"], check=True)
@app.command()
def log():
subprocess.run(args + ["log"], check=True)
@app.command()
def lock():
subprocess.run(args + ["ipc"] + ["call"] + ["lock"] + ["lock"], check=True)
@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)