Coverage for src/types/commands.py: 100.00%
12 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 typing import List
6# Commands class, pylint: disable=too-few-public-methods
7class Commands:
9 # Members
10 __arguments: List[str]
12 # Constructor
13 def __init__(self, arguments: List[str]) -> None:
15 # Prepare arguments
16 if isinstance(arguments, list):
17 self.__arguments = arguments
18 else: # pragma: no cover
19 self.__arguments = []
21 # Getter
22 def get(self) -> str:
24 # Variables
25 command: List[str] = []
27 # Prepare command
28 for argument in self.__arguments:
30 # Quoted argument
31 if ' ' in argument:
32 command += [f'\'{argument}\'']
34 # Standard argument
35 else:
36 command += [argument]
38 # Result
39 return ' '.join(command)