This commit is contained in:
2025-04-15 01:09:03 +03:00
parent e189f8d9aa
commit 9522b0161a
7 changed files with 123 additions and 20 deletions
+4 -1
View File
@@ -4,7 +4,10 @@ import re
@dataclass
class PredeterminedFlags:
class PredefinedFlags:
"""
Public. A dataclass with predefined flags and most frequently used flags for quick use
"""
HELP = Flag(name='help', possible_values=False)
SHORT_HELP = Flag(name='h', prefix='-', possible_values=False)
+11 -1
View File
@@ -2,13 +2,23 @@ from typing import Literal, Pattern
from abc import ABC, abstractmethod
class BaseFlag:
class BaseFlag(ABC):
def __init__(self, name: str,
prefix: Literal['-', '--', '---'] = '--'):
"""
Private. Base class for flags
:param name: the name of the flag
:param prefix: the prefix of the flag
:return: None
"""
self._name = name
self._prefix = prefix
def get_string_entity(self):
"""
Private. Returns a string representation of the flag
:return: None
"""
string_entity: str = self._prefix + self._name
return string_entity