clan-core/pkgs/clan-cli/clan_cli/backups/__init__.py
lassulus e772d29f44
All checks were successful
checks-impure / test (pull_request) Successful in 1m4s
checks / test (pull_request) Successful in 2m33s
implement backup cli for borgbackup
2023-12-04 17:47:23 +01:00

26 lines
788 B
Python

# !/usr/bin/env python3
import argparse
from .create import register_create_parser
from .list import register_list_parser
from .restore import register_restore_parser
# takes a (sub)parser and configures it
def register_parser(parser: argparse.ArgumentParser) -> None:
subparser = parser.add_subparsers(
title="command",
description="the command to run",
help="the command to run",
required=True,
)
list_parser = subparser.add_parser("list", help="list backups")
register_list_parser(list_parser)
create_parser = subparser.add_parser("create", help="create backups")
register_create_parser(create_parser)
restore_parser = subparser.add_parser("restore", help="restore backups")
register_restore_parser(restore_parser)