onyx-and-iris d0519bb8e9 add spinners for all commands (including interactive mode).
pass send_command(interpret=True) for commands that return long responses.
note, it strips the first `"` from cvar responses which causes CVAR_REGEX to fail.
2026-03-23 14:45:35 +00:00

22 lines
649 B
Python

from aioq3rcon import Client
from clypi import Command, Spinner, arg
from typing_extensions import override
from q3rcon_cli import console
class Fastrestart(Command):
"""Executes a fast restart of the server."""
host: str = arg(inherited=True)
port: int = arg(inherited=True)
password: str = arg(inherited=True)
@override
async def run(self):
async with Spinner('Executing fast restart', suffix='...'):
async with Client(self.host, self.port, self.password) as client:
response = await client.send_command('fast_restart', interpret=True)
console.out.print_response(response)