Files
Baber Abbasi b315ef3b05 refactor: Cli (#3440)
modular subcommands (run/ls/validate), YAML config support (--config), new EvaluatorConfig dataclass.
2025-12-02 19:39:16 +05:00

20 lines
480 B
Python

import argparse
from abc import ABC, abstractmethod
class SubCommand(ABC):
"""Base class for all subcommands."""
def __init__(self, *args, **kwargs):
pass
@classmethod
def create(cls, subparsers: argparse._SubParsersAction):
"""Factory method to create and register a command instance."""
return cls(subparsers)
@abstractmethod
def _add_args(self) -> None:
"""Add arguments specific to this subcommand."""
pass