Files
clan-core/pkgs/clan-cli/clan_cli/templates/apply.py
Jörg Thalheim 758eacd27e add apply "machine" as an alias to clan machines create
I was a bit confused that I was able to list templates but not
apply them. Turns out that "apply" only supported disk templates
2025-08-27 13:39:39 +00:00

19 lines
681 B
Python

import argparse
from .apply_disk import register_apply_disk_template_parser
from .apply_machine import register_apply_machine_template_parser
def register_apply_parser(parser: argparse.ArgumentParser) -> None:
subparser = parser.add_subparsers(
title="template_type",
description="the template type to apply",
help="the template type to apply",
required=True,
)
disk_parser = subparser.add_parser("disk", help="Apply a disk template")
machine_parser = subparser.add_parser("machine", help="Apply a machine template")
register_apply_disk_template_parser(disk_parser)
register_apply_machine_template_parser(machine_parser)