1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-22 12:53:00 +00:00
kiwi-scp/kiwi_scp/commands/cmd_list.py

30 lines
747 B
Python
Raw Normal View History

2021-10-21 02:02:38 +00:00
import click
2021-11-02 16:21:01 +00:00
from .cli import KiwiCommandType, KiwiCommand
from .decorators import kiwi_command
2021-10-29 11:38:21 +00:00
from ..config import ProjectConfig
from ..instance import Instance, Services
2021-10-29 11:59:57 +00:00
@click.option(
"-s/-S",
"--show/--no-show",
help=f"EXAMPLE",
)
2021-10-29 11:38:21 +00:00
@kiwi_command(
2021-10-22 15:52:46 +00:00
"list",
2021-11-02 16:21:01 +00:00
KiwiCommandType.PROJECT,
2021-10-22 15:52:46 +00:00
short_help="Inspect a kiwi-scp instance",
)
2021-11-02 16:21:01 +00:00
class CMD(KiwiCommand):
2021-10-29 11:38:21 +00:00
@classmethod
2021-10-29 11:59:57 +00:00
def run_for_instance(cls, instance: Instance, show: bool = None, **kwargs):
print(show)
2021-10-29 11:38:21 +00:00
print(instance.config.projects)
@classmethod
2021-10-29 11:59:57 +00:00
def run_for_services(cls, instance: Instance, project: ProjectConfig, services: Services, show: bool = None,
**kwargs):
print(show)
2021-10-29 11:38:21 +00:00
print(services)