#! /usr/bin/env python3
import dataclasses
import pathlib
from typing import Annotated
import tyro
@dataclasses.dataclass
class Arguments:
# logs files paths to process
logfile_paths: tyro.conf.Positional[tuple[pathlib.Path, ...]]
# configuration file for the drain3 template miner.
cfg_file: Annotated[pathlib.Path, tyro.conf.arg(aliases=["-c"])] = pathlib.Path(
"config.yaml"
)
if __name__ == "__main__":
cfg = tyro.cli(Arguments)
print(cfg)
i run this command :
./tyrobug.py --invalid
With tyro 1.0.8 (good):
╭─ Unrecognized options ─────────────────────╮
│ Unrecognized options: --invalid │
│ ────────────────────────────────────────── │
│ For full helptext, run ./tyrobug.py --help │
╰────────────────────────────────────────────╯
with tyro >=1.0.9:
No error (not good)
Arguments(logfile_paths=(PosixPath('--invalid'),), cfg_file=PosixPath('config.yaml'))
i run this command :
./tyrobug.py --invalidWith tyro 1.0.8 (good):
with tyro >=1.0.9:
No error (not good)
Arguments(logfile_paths=(PosixPath('--invalid'),), cfg_file=PosixPath('config.yaml'))