2025-11-15 14:41:07 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
2026-01-20 15:49:53 +01:00
|
|
|
|
2025-11-15 14:41:07 +01:00
|
|
|
from argparse import ArgumentParser
|
|
|
|
|
|
2026-01-27 10:22:16 +01:00
|
|
|
from ..App import App
|
2026-01-21 14:29:10 +01:00
|
|
|
from ..lib.Cmd import Cmd as Base
|
2026-01-20 15:49:53 +01:00
|
|
|
from ..lib.Types import LoadTypes
|
2026-01-21 14:29:10 +01:00
|
|
|
|
|
|
|
|
class Cmd(Base): # export
|
2025-11-15 14:41:07 +01:00
|
|
|
|
2026-01-27 10:22:16 +01:00
|
|
|
def __init__(self, parent: App|Base, name: str, help: str) -> None:
|
|
|
|
|
super().__init__(parent, name, help)
|
2026-01-20 15:49:53 +01:00
|
|
|
|
|
|
|
|
def _add_subcommands(self) -> None:
|
|
|
|
|
self.add_subcommands(
|
|
|
|
|
LoadTypes(
|
|
|
|
|
[__name__.rsplit('.', 1)[0] + '.' + self.name],
|
|
|
|
|
type_name_filter=r'Cmd[^.]'
|
|
|
|
|
)
|
|
|
|
|
)
|