Coverage for src/cli/entrypoint.py: 100.00%
13 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-22 10:53 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-22 10:53 +0000
1#!/usr/bin/env python3
3# Standard libraries
4from argparse import Namespace
5from enum import Enum
7# Components
8from ..features.actions import ActionsFeature
9from ..types.commands import Commands
11# Entrypoint class, pylint: disable=too-few-public-methods
12class Entrypoint:
14 # Enumerations
15 Result = Enum('Result', [
16 'SUCCESS',
17 'FINALIZE',
18 'ERROR',
19 'CRITICAL',
20 ])
22 # CLI, pylint: disable=too-many-branches,too-many-locals,too-many-return-statements
23 @staticmethod
24 def cli(options: Namespace) -> Result:
26 # Variables
27 result: Entrypoint.Result = Entrypoint.Result.ERROR
29 # Prepare command
30 command: str = Commands(options.command).get()
32 # Action executor
33 if ActionsFeature(command, options).run():
34 result = Entrypoint.Result.SUCCESS
36 # Result
37 return result