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

1#!/usr/bin/env python3 

2 

3# Standard libraries 

4from argparse import Namespace 

5from enum import Enum 

6 

7# Components 

8from ..features.actions import ActionsFeature 

9from ..types.commands import Commands 

10 

11# Entrypoint class, pylint: disable=too-few-public-methods 

12class Entrypoint: 

13 

14 # Enumerations 

15 Result = Enum('Result', [ 

16 'SUCCESS', 

17 'FINALIZE', 

18 'ERROR', 

19 'CRITICAL', 

20 ]) 

21 

22 # CLI, pylint: disable=too-many-branches,too-many-locals,too-many-return-statements 

23 @staticmethod 

24 def cli(options: Namespace) -> Result: 

25 

26 # Variables 

27 result: Entrypoint.Result = Entrypoint.Result.ERROR 

28 

29 # Prepare command 

30 command: str = Commands(options.command).get() 

31 

32 # Action executor 

33 if ActionsFeature(command, options).run(): 

34 result = Entrypoint.Result.SUCCESS 

35 

36 # Result 

37 return result