---
source: lib/src/sdk/python/mod.rs
expression: client
---
# @generated by usage-cli from test.usage.kdl. Do not edit manually.
from __future__ import annotations
from typing import Optional
from .runtime import CliResult, CliRunner
from .types import ToolFlags

class Tool:
    def __init__(self, bin_path: str = "tool") -> None:
        self._runner = CliRunner(bin_path)

    def exec(self, flags: Optional[ToolFlags] = None) -> CliResult:
        """[-f --format <fmt>]"""
        cmd_args: list[str] = []
        flag_args = self._build_flag_args(flags)
        return self._runner.run(cmd_args + flag_args)

    def _build_flag_args(self, flags: Optional[ToolFlags]) -> list[str]:
        result: list[str] = []
        if flags is None: return result
        if flags._format is not None: result.extend(["--format", str(flags._format)])
        return result
