diff options
author | crupest <crupest@outlook.com> | 2024-11-11 01:12:29 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-01-08 22:37:23 +0800 |
commit | 43892b892cfdc4e15f7ab191c42ccb32279fd7f6 (patch) | |
tree | 9161420d397b95d24a0ac90629e0eab27f1b337f /tools/cru-py/cru/service/_template.py | |
parent | c3308421b665e5d8dcb70b78acf137541a026555 (diff) | |
download | crupest-43892b892cfdc4e15f7ab191c42ccb32279fd7f6.tar.gz crupest-43892b892cfdc4e15f7ab191c42ccb32279fd7f6.tar.bz2 crupest-43892b892cfdc4e15f7ab191c42ccb32279fd7f6.zip |
HALF WORK: 2024.1.8
Diffstat (limited to 'tools/cru-py/cru/service/_template.py')
-rw-r--r-- | tools/cru-py/cru/service/_template.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/cru-py/cru/service/_template.py b/tools/cru-py/cru/service/_template.py index 5f0252a..23bff4d 100644 --- a/tools/cru-py/cru/service/_template.py +++ b/tools/cru-py/cru/service/_template.py @@ -1,4 +1,4 @@ -from argparse import ArgumentParser, Namespace +from argparse import Namespace from cru import CruIterator from cru.template import TemplateTree @@ -11,6 +11,8 @@ class TemplateManager(AppCommandFeatureProvider): def __init__(self, prefix: str = OWNER_NAME.upper()): super().__init__("template-manager") self._prefix = prefix + + def setup(self) -> None: self._templates_dir = self.app.add_path("templates", True) self._generated_dir = self.app.add_path("generated", True) self._template_tree: TemplateTree | None = None @@ -56,7 +58,10 @@ class TemplateManager(AppCommandFeatureProvider): self.generated_dir.full_path_str, config_manager.config_map ) - def add_arg_parser(self, arg_parser: ArgumentParser) -> None: + def get_command_info(self): + return ("template", "Template Management") + + def setup_arg_parser(self, arg_parser): subparsers = arg_parser.add_subparsers(dest="template_command") _list_parser = subparsers.add_parser("list", help="List templates.") _generate_parser = subparsers.add_parser("generate", help="Generate template.") |