"""CLICommandBase class."""
import abc
from typing import TYPE_CHECKING
if TYPE_CHECKING: # pragma: no cover
from argparse import ArgumentParser, Namespace
[docs]
class CLICommandBase(abc.ABC):
"""CLI command base class."""
command_help: str
command_name: str
[docs]
@abc.abstractmethod
def create_parser(self, command_parser: "ArgumentParser") -> None:
"""Create an argument parser for this CLI command.
:param command_parser: The root argparse parser to attach to.
"""
[docs]
@abc.abstractmethod
def invoke(self, args: "Namespace") -> None:
"""Invoke this CLI command.
:param args: The argparse namespace to use.
"""