clan-core/pkgs/clan-cli/clan_cli/state/__init__.py
a-kenji 3bcaeda737 cli: add command to list state
Add a subcommand to list configured state for a specific machine.

Example:
```
$ clan state list [MACHINE]
```
2024-06-25 09:34:31 +00:00

35 lines
915 B
Python

# !/usr/bin/env python3
import argparse
from .list import register_state_parser
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,
)
state_parser = subparser.add_parser(
"list",
help="list state folders and the services that configure them",
description="list state folders and the services that configure them",
epilog=(
"""
List state of the machines managed by clan.
Examples:
$ clan state list [MACHINE]
List state of the machine [MACHINE] managed by clan.
For more detailed information, visit: https://docs.clan.lol/getting-started/backups/
"""
),
formatter_class=argparse.RawTextHelpFormatter,
)
register_state_parser(state_parser)